Basic Linux network configuration

Source: Internet
Author: User
Linux network basic configuration Ethernet connection in Linux, the Ethernet interface is run in the following command: eth0, eth1, etc, 0, 1 indicates that the network card number can be viewed through the lspci command (if it is a usb interface, lsusb may be used) ifconfig command to view the connection... basic Linux network configuration
Linux network basic configuration Ethernet connection in Linux, the Ethernet interface is run with the following command: eth0, eth1, etc. 0, 1 indicates the network card number. you can use the lspci command to view the online hardware information (if it is a usb interface, you may want to use lsusb) command ifconfig command to view the interface information ifconfig-a view all interfaces ifconfig eth0 view specific interfaces in CentOS can use the command ifup, ifdown is used to enable, disable an interface ifup eth0, enable eth0 Nic ifdown eth0, disable eth0 Nic in ubuntu you can use ifconfig Nic up, ifconfig Nic down do the same function sudo ifconfig eth0 up, enable eth0 Nic sudo ifconfig eth0 down, disable eth0 Nic configuration network information. in CentOS, you can use the setup command to configure network information. Ubuntu can use the following command [python] view plaincopy # set ip address, netmask (subnet mask), broadcast (broadcast address) ifconfig eth0 192.168.137.220 netmask 255.255.255.0 broadcast 192.168.137.255 up # set gateway (gateway) route add default gw 192.168.137.254 network-related configuration file the following is the location of the CentOS configuration file. if there is no special description of the Ubunt-related configuration file, configuration file/etc/sysconfig/network-scripts/ifcfg-eth0DNS configuration file/etc/resolv. conf (same for Ubuntu) host name configuration file/etc/sysconfig/network static host name configuration file/etc/hosts (same for Ubuntu) network test command to test network connectivity: ping 192.168.137.254ping www.baidu.com to test DNS resolution host www. baidu. comdig www.baidu.com displays the route table: the ip route tracks the network route to the target address through traceroute www.baidu.com using mtr for network quality testing (combined with traceroute and ping) mtr www.baidu.com troubleshooting from bottom to high, check whether the network configuration information is correct from inside to outside the IP address subnet mask gateway DNS check whether the gateway is connected to ping gateway IP address to check whether DNS resolution is normal
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.