File:/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 a 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-this device will be activated at boot time.
o No-this device is not activated when boot.
* Userctl=answer, here answer take one of the following values:
o Yes-a non-root user can control the device.
o No-the device is not allowed to be controlled by a non-root user.
* Bootproto=proto, here Proto take one of the following values:
o None--does not use the boot-time protocol.
o BOOTP-use BOOTP protocol.
o DHCP-use DHCP protocol.
Terminal: Query IP address: ifconfig-a
To modify the LAN IP:
1. Log in as Root
2. Modify the configuration file
/etc/sysconfig/network-scripts/ifcfg-eth0
The contents of the document 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 column 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
[Aeolus@db1 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 DNS
[Aeolus@db1 etc]$ VI resolv.conf
NameServer 202.96.128.68
NameServer 219.136.241.206
Four, restart network configuration
/etc/init.d/network restart
Modify IP Address
Immediate effect:
# ifconfig eth0 192.168.0.20 netmask 255.255.255.0
Start in effect:
Modify/etc/sysconfig/network-scripts/ifcfg-eth0
Modify the default gateway
Immediate effect:
# route add default GW 192.168.0.254
Start in effect:
Modify/etc/sysconfig/network-scripts/ifcfg-eth0
Modify DNS
Modify/etc/resolv.conf
Can be effective immediately after modification
Modify Host Name
Immediate effect:
# hostname FC2
Start in effect:
Modify/etc/sysconfig/network