About settings: you can manually modify the network address or add a new network interface to the new interface by modifying the corresponding file (ifcfg-ethN) or creating a new file. DEVICE = namename indicates the name of the physical DEVICE. IPADDR = addraddr indicates the IP address assigned to the card. NETMASK = mask about settings:
You can manually modify the network address or add a new network interface to the new interface by modifying the corresponding file (ifcfg-ethN) or creating a new file.
DEVICE = name indicates the name of the physical DEVICE.
IPADDR = addr indicates the IP address assigned to the card
NETMASK = mask indicates the network mask
NETWORK = addr indicates the NETWORK address
BROADCAST = addr indicates the BROADCAST address.
ONBOOT = yes/no whether the card is activated at startup
GATEWAY = 192.168.1.102 GATEWAY address
None: no startup protocol required
Bootp: Use the bootp protocol
Dhcp: Use the dhcp protocol.
USERCTL = yes/no whether non-root users are allowed to control the device
Modify: the parameters of DEVICE = include dhcp and static, respectively, indicating dynamic and static receiving,
Content in eth0 (static IP address:
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE = eth0
BROADCAST = 192.168.1.255
BOOTPROTO = static
IPADDR = 192.168.1.56
NETMASK = 255.255.255.0
NETWORK = 192.168.1.1
GETEWAY = 192.168.1.102
PEERDNS = no
ONBOOT = yes
Content in eth1 (dynamic receiving IP address:
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE = eth1
BOOTPROTO = dhcp
ONBOOT = yes
HWADDR = 00: 0c: 29: 9b: 0e: f9
Add a temporary IP address command: ifconfig eth0 192.168.1.12 netmask 255.255.255.0
Add a temporary Gateway command: route add default gw 192.168.1.102
The preceding two commands are unavailable after the NIC is restarted (service network restart ).
View:
Available
Netstat-nr and route-nv view the ip address and Gateway Information of eth0 and eth1;
Ip route show: view the corresponding information of each network card