Liunux Networking Mode Configuration

Source: Internet
Author: User

Set a static IP address for the machine under Linux:

Vim/etc/sysconfig/network-scripts/ifcfg-eth0

Modify the contents of this file in the following form:

# Intel Corporation 82541GI Gigabit Ethernet Controller

Device=eth0

Bootproto=static #为静态的

Hwaddr=00:15:17:b2:dc:b5

Onboot=yes

ipaddr=10.20.134.199 #这个是设置的静态IP地址

netmask=255.255.254.0

gateway=10.20.134.1 #网关

After modification, the need to restart the network is changed to take effect:/etc/init.d/network Restart, automatically get dynamic IP address mode:

Vim/etc/sysconfig/network-scripts/ifcfg-eth1

The contents are as follows:

# Intel Corporation 82566dm-2 Gigabit Network Connection

Device=eth1

Bootproto=dhcp #动态获取IP

Hwaddr=00:15:17:b2:dc:b7

Onboot=no

Run command:dhclient eth1 , automatically get the dynamic IP address, you can view the assigned IP address by: ifconfig.

Vim/etc/resolv.conf

Used to define the following four items

NameServer #定义DNS服务器的IP地址, this is the most important

Domain #定义本地域名

Search #定义域名的搜索列表

Sortlist #对返回的域名进行排序

To set up PPPoE dial-up access:

PPPoE is an ADSL network encapsulation protocol, the realization of ADSL Internet dialing. It is already installed by default and can be queried for confirmation.

1. Confirm Installation Rp-pppoe -rpm-q Rp-pppoe

Rp-pppoe-3.5-2

2. Rp-pppoe Configuration Adsl-setup Welcome to the ADSL client setup. First, I'll run some checks on
Your system to make sure the PPPoE client is installed properly ...

LOGIN NAME
#请输入adsl帐户名:
Enter your Login Name (default root): gzdsl123456789

INTERFACE
#哪一块网卡连接的是adsl Moden:
Enter the Ethernet interface connected to the ADSL modem
For Solaris, this is likely to be something LIKE/DEV/HME0.
For Linux, it'll be EthX, where ' X ' is a number.
(default eth0): eth1

#是否需要按需拨号: Default no for annual subscription
Does want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
After which the link should is dropped. If you want the link to
Stay up permanently, enter ' no ' (Letters, lower-case.)
Note:demand-activated links do not interact well with dynamic IP
Addresses. Some problems with demand-activated links.
Enter the demand value (default NO):

#输入server自动获取dns服务器IP
Dns

Please enter the IP address of your ISP ' s primary DNS server.
If your ISP claims that ' the server would provide dynamic DNS addresses ',
Enter ' server ' (all lower-case) here.
If you just press ENTER, I'll assume you know
Doing and not modify your DNS setup.
Enter the DNS information here:server

PASSWORD
#输入adsl帐户密码
Please enter your password:xxxxxxx
Please re-enter your Password:

Userctrl
#是否允许一般用户断开adsl连接, you can enter no
Please enter ' Yes ' (both letters, lower-case.) If you want
Normal user to start or stop DSL connection (default Yes): Yes

#选择防火墙的类型, 0 for no firewall
The firewall choices is:
0-none:this script won't set any firewall rules. You are responsible
For ensuring the security of your machine. You are strongly
Recommended to use some kind of firewall rules.
1-standalone:appropriate for a basic stand-alone web-surfing workstation
2-masquerade:appropriate for a machine acting as an Internet gateway
For a LAN
Choose a type of firewall (0-2): 0

Start this connection at boot time
#系统启动时, whether to dial automatically, for debugging convenience, select No
Does want to start this connection at boot time?
Please enter no or Yes (default NO): No

* * Summary of what entered * *
#确认无误后, the configuration file is generated automatically.
Ethernet interface:eth1
User name:gzdsl123456789
Activate-on-demand:no
DNS addresses:supplied by ISP ' s server
Firewalling:none
User Control:yes
Accept These settings and adjust configuration files (y/n)? y

#adsl配置文件如下
Adjusting/etc/sysconfig/network-scripts/ifcfg-ppp0
Adjusting/etc/ppp/chap-secrets and/etc/ppp/pap-secrets
(but first backing it up To/etc/ppp/chap-secrets.bak)
(but first backing it up To/etc/ppp/pap-secrets.bak)

Congratulations, it should is all set up!

Type '/sbin/ifup ppp0 ' to bring up your xDSL link and '/sbin/ifdown ppp0 '
To bring it down.
Type '/sbin/adsl-status/etc/sysconfig/network-scripts/ifcfg-ppp0 '
To see the link status.

ADSL Script Control
ADSL dialing
Adsl-start
Show ADSL Connection Status
Adsl-status
Disconnecting the ADSL connection
Adsl-stop

Liunux Networking Mode configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.