- IP Immediate effect (failed after reboot):
ifconfig eth0 192.168.1.102 netmask 255.255.255.0 route add default GW 192.168.1.1&nbs p; ////Add IP address Add gateway
- IP boot takes effect:
vim/etc/sysconfig/network-scripts/ifcfg-eth0 (Some versions may not have vim in this editor such as CentOS, you may replace with VI)
ipaddr=192.168.1.102 //Add IP address
netmask= 255.255.255.0//Mask
gateway=192.168.1.1//Add Gateway
The final result is as follows:
Device=eth0
bootproto=static
ipaddr= 192.168.1.102
netmask=255.255.255.0
geteway=192.168.1.1
Onboot=yes
Type=ethernet
Note: Bootproto can only use the IP information set in static (static) mode
actual experience: CentOS 6.5 64-bit IP immediate effect √ IP start Active: x |
- Modify DNS
vim/etc/resolv.conf ;
Join Nameserver= ***.***.***.***
//modified to take effect immediately, start the same effective
The
above excerpt: Linux configuration NIC IP address command detailed introduction and some common network configuration commands
Linux command----network address