Just started playing Linux children's shoes may have such a problem, I clearly with ifconfig eth0 192.168.0.37 set up the Eth0 network, and Ifconfig view network card information when the Eth0 network is also correct, but when we ping 192.168.0.1, why does the ping still show?
The original Linux has two sets of management network connection scheme
(1)/etc/init.d/networking (/etc/network/interfaces)
(2) Network-manager
Two sets of scenarios are conflicting and cannot be shared at the same time
The first scenario is for environments that do not have a Linux interface, such as servers or those where there is no need to change connections;
The second package is for environments with Linux desktops, especially laptops to move around, and network connectivity can change at any time.
Both of them to avoid conflict and to share the configuration, there is the following solution:
When Network-manager discovers that/etc/init.d/networking is altered, it turns off its display unmanaged unless managed is set to true.
When managed is set to true,/etc/init.d/networking does not take effect.
In this view, the Linux system is preferred to use the NetworkManager network, if you want to set up the network with the command line should first shut down the NetworkManager service, open the Network service, all operations must be performed with root permissions
[[email protected] task]$ sudo chkconfig--level 2345 NetworkManager off
[[email protected] task]$ sudo chkconfig--level 2345 Network on
[[email protected] task]$ sudo service NetworkManager stop
[[email protected] task]$ sudo service network start
The following can be used to set the IP address on the command line:
Configure the IP address of the eth0 and activate the device
[[email protected] task]$ sudo ifconfig eth0 192.168.0.37 netmask 255.255.255.0 up
Add a default gateway
[[email protected] task]$ sudo route add default GW 192.168.0.1
To activate the device:
[[email protected] task]$ sudo ifconfig eth0 up
To disable a device:
[email protected] task]$ sudo ifconfig eth0 down
Reference Blog: http://www.cnblogs.com/bo083/archive/2012/11/23/2785172.html
Linux Network configuration