The configured address takes effect immediately, but fails to restart the Network service or host
Network Services
RHEL5:/etc/init.d/network {start|stop|restasrt|status}
RHEL6:/etc/init.d/networkmanager | {Start|stop|restasrt|status}
Gateway:
Route routing
Route add: Add route
-host: Adding host routes
-net: Adding network routes
-net 0.0.0.0 Add a default route
Liezi:
Route Add-net | -host DEST GW Nexthop
Route add default GW nexthop
Route del: Delete route
-host
-net
Liezi:
Route Del-net 10.0.0.0/8
Route Del-net 0.0.0.0
Routel del Default
Note: The route command looks at the native routing table
Route-n Digital display of information about each host or port
Note: Changes made to restart the Network service or host after the failure
Network configuration file:
[Email protected] ~]# cat/etc/sysconfig/network
Network Interface configuration file:
[Email protected] ~]# Cat/etc/sysconfig/network-scripts/ifcfg-eth0
The configuration file is as follows:
[Email protected] ~]# cd/etc/sysconfig/network-scripts/[[email protected] network-scripts]# cat Ifcfg-eth0
IPADDR=:IP address netmask=: Subnet mask gateway=: Set default gateway Userctl={yes | No}: Allow normal user to control this interface Peerdns={yes | NO}: The DNS address specified by the DHCP server is accepted when Bootproto is DHCP; [email protected] network-scripts]#
Note: Changing the configuration in the configuration file will not take effect immediately, but restarting the network service or host will take effect;
Restart Network Service:
[Email protected] network-scripts]#/etc/init.d/network restart
The DNS server specifies only one method:
[Email protected] ~]# cat/etc/resolv.conf
nameserver dns_ip_1
NameServer dns_ip_2
This article is from the "Linux Operations Technology Exchange" blog, please be sure to keep this source http://linuxzhang.blog.51cto.com/2580498/1673924
Ifconfig of network configuration and detailed description of IP commands