Files:/etc/sysconfig/network-scripts/ifcfg-eth0
The following values are common in all basic configuration files:
* Device=name, where name is the name of the physical device (except for dynamically assigned PPP devices,
Its name is "logical name".
* Ipaddr=addr, here addr is the IP address.
* Netmask=mask, here Mask is the netmask.
* Network=addr, here addr is the network address.
* Broadcast=addr, here addr is the broadcast address.
* Gateway=addr, here addr is the gateway address.
* Onboot=answer, here answer take one of the following values:
o Yes-the device will be activated at boot.
o No-the device is not activated at boot.
* Userctl=answer, here answer take one of the following values:
o Yes-the non-root user can control the device.
o No--non-root users are not allowed to control the device.
* Bootproto=proto, here Proto take one of the following values:
o None-no boot-time protocol is used.
o BOOTP-uses the BOOTP protocol.
o DHCP-uses the DHCP protocol.
Add: There seems to be a defroute parameter that is used to set the default route.
Terminal: Query IP address: ifconfig-a
Modify the LAN IP:
1. Log in as Root
2. Modify the configuration file
/etc/sysconfig/network-scripts/ifcfg-eth0
The contents of the file are as follows:
\device=eth0
Hwaddr=00:0c:29:a2:8c:b2
Onboot=yes
Type=ethernet
netmask=255.255.255.0
ipaddr=192.168.1.11, modified to 192.168.1.12
gateway=192.168.1.1
Reboot
This section more highlights: http://www.bianceng.cn/OS/Linux/
ifconfig eth0 New IP then edit/etc/sysconfig/network-scripts/ifcfg-eth0, modify IP
ifconfig eth0 New IP
Then edit/etc/sysconfig/network-scripts/ifcfg-eth0, modify IP
First, modify the IP address
[Email protected] network-scripts]$ VI ifcfg-eth0
Device=eth0
Onboot=yes
Bootproto=static
ipaddr=219.136.241.211
netmask=255.255.255.128
gateway=219.136.241.254
Second, modify the gateway
Vi/etc/sysconfig/network
Networking=yes
Hostname=aaron
gateway=192.168.1.1
Third, modify the DNS
[Email protected] etc]$ VI resolv.conf
NameServer 202.96.128.68
NameServer 219.136.241.206
Iv. Restarting the network configuration
/etc/init.d/network restart
Modify IP Address
Immediate effect:
# ifconfig eth0 192.168.0.20 netmask 255.255.255.0
Activation takes effect:
Modify/etc/sysconfig/network-scripts/ifcfg-eth0
Modify the default gateway
Immediate effect:
# route add default GW 192.168.0.254
Activation takes effect:
Modify/etc/sysconfig/network-scripts/ifcfg-eth0
Modify DNS
Modify/etc/resolv.conf
Modified to take effect immediately, start the same effective
Modify Host Name
Immediate effect:
# hostname FC2
Activation takes effect:
Modify/etc/sysconfig/network
Configuration of NIC in Linux system