Linux Network configuration

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.