Linux Network Configuration ·

Source: Internet
Author: User

One: Configuration file

/etc/hosts

Local Host IP address mapping

Content: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6

/etc/services

The correspondence between port numbers and standard services

Individual fields: Service-name Port/protocol aliases Comment

/etc/sysconfig/network

Set host name Gateway domain name

/etc/rc.d/init.d/network

Service network restart is equivalent to/etc/rc.d/init.d/network restart

NIC configuration file:

/etc/sysconfig/network-scripts/ifcfg-eth*

Device=eth0 NIC corresponding name
Onboot=yes
bootproto=static (static IP status setting)
BOOTPROTO=DHCP (DHCP Fetch)
ipaddr=192.168.1.8 (static IP address)
netmask=255.255.255.0
gateway=192.168.1.1 (Gateway) (if you set the gateway here, the settings in/etc/sysconfig/network are not valid)
Macaddr=00:0c:29:96:38:f8 (Modify MAC address)

DNS-related configuration files

/etc/host.conf

/etc/nsswitch.conf

/etc/resolv.conf

Command

ifconfig eth0 IP address netmask subnet mask up

Common Test Commands

PING-C 4 IP Address

Route operates on the IP routing table of the kernel, setting static routes for the host or network of configured interfaces

Route add-net IP address netmask subnet mask eth0 Add a routing entry to the IP address of the network

Route del-net IP address netmask subnet mask

Route-c Viewing buffer tables

ROUTE-N Route Tracking

Linux Network Configuration ·

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.