Linux Network routing configuration

Source: Internet
Author: User

Network Card configuration file Description:

# Vi/etc/sysconfig/network-scripts/ifcfg-eth0

Device=eth0 (describes the device alias for the NIC, for example, it is eth0 in the Ifcfg-eth0 file)

Bootproto=static (Sets the way the network card obtains an IP address, the possible options are static,dhcp or BOOTP, respectively, corresponding to the static specified IP address, IP address obtained through the DHCP protocol, IP address obtained through the BOOTP protocol)

broadcast=192.168.0.255 (corresponding subnet broadcast address)

HWADDR=00:07:E9:05:E8:B4 (the corresponding network card physical address)

ipaddr=12.168.1.2 (This field specifies the IP address of the NIC if the IP address is specified statically for the network card)

Ipv6init=no (Turn IPv6 on or off; turn off no, turn on Yes)

Ipv6_autoconf=no (turn on or off the IPV6 automatic configuration; Turn off no, turn on Yes)

gateway=192.168.1.1 (Configure Gateway)

netmask=255.255.255.0 (Network mask corresponding to NIC)

network=192.168.1.0 (network address corresponding to the NIC)

Onboot=yes (If this network interface is set at system startup and set to Yes, this device is activated when the system starts)

Service Network Restart re-activating the NIC

Modify the DNS configuration file for the corresponding NIC

# vi/etc/resolv.conf

Modify the following content

NameServer 8.8.8.8 #google域名服务器


Temporary network address configuration (restart failure): ifconfig eth0 192.168.1.254netmask 255.255.255.0

Start/Close off network card: ifconfig eth0 Up/down

Permanent address configuration Modify configuration file/etc/sysconfig/network-scriprit/ifcfg-eth0

Set multiple IPs for a network card

Ifconfig eth0 xxxxxxx

Ifconfig eth0:0 xxxxxxx

View the routing table route-n

Gateway for 0.0.0.0 means direct transfer from native

Add Delete route: Route add/del-net xxxxx Netmaskxxxxxx Dev Ethx

Linux Network routing 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.