Modify IP address and gateway is a very common operation, in doing related experiments, if not set well, will bring a lot of unnecessary trouble.
1. Modify IP Address
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0
Bootproto=none
broadcast=192.168.1.255
ipaddr=192.168.1.33
netmask=255.255.255.0
network=192.168.1.0
Onboot=yes
Userctl=no
Peerdns=no
Type=ethernet
If you have 2 network adapters, the second information is stored in the Ifcfg-eth1 file.
Vi/etc/sysconfig/network-scripts/ifcfg-eth1
Device=eth1
Onboot=yes
Bootproto=none
ipaddr=192.168.2.34
netmask=255.255.255.0
Userctl=no
Peerdns=no
Type=ethernet
Netwo
Modify IP address and gateway is a very common operation, in doing related experiments, if not set well, will bring a lot of unnecessary trouble.
1. Modify IP Address
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0
Bootproto=none
broadcast=192.168.1.255
ipaddr=192.168.1.33
netmask=255.255.255.0
network=192.168.1.0
Onboot=yes
Userctl=no
Peerdns=no
Type=ethernet
If you have 2 network adapters, the second information is stored in the Ifcfg-eth1 file.
Vi/etc/sysconfig/network-scripts/ifcfg-eth1
Device=eth1
Onboot=yes
Bootproto=none
ipaddr=192.168.2.34
netmask=255.255.255.0
Userctl=no
Peerdns=no
Type=ethernet
network=192.168.2.0
broadcast=192.168.2.255
2. Modify Gateway
Vi/etc/sysconfig/network
Networking=yes
Hostname=aaron
gateway=192.168.1.1
3. Restart Network configuration: After modifying the IP and gateway, restart the Network service before it takes effect.
/etc/init.d/network restart
rk=192.168.2.0
broadcast=192.168.2.255
2. Modify Gateway
Vi/etc/sysconfig/network
Networking=yes
Hostname=aaron
gateway=192.168.1.1
3. Restart Network configuration: After modifying the IP and gateway, restart the Network service before it takes effect.
/etc/init.d/network restart
This article URL address: http://www.bianceng.cn/OS/Linux/201410/45489.htm