Linux network configuration and Tools __linux

Source: Internet
Author: User
First, view 1.1, ifconfig eno1 view IP, receive packets and send packetsView network card history send and receive packets PX, etc. 1.2,//mii-tool is mainly used to configure the operating mode of the network card instructions, but also can carry out inquiries, monitoring and other work. [Root@localhost root]# Mii-tool
eth0:negotiated 100basetx-fd, link ok
Eth1:no Link
1.3./etc/init.d/network Status or service network status or SYSTEMCTL status networkNetwork reboot, when the server needs networking, find the corresponding network card, disable the existing network card: Ifconfig eno1 down restart Services: Service network restart boot need network card: ifconfig ENO2 up NOTE: Network card ENO2 need To set the Onboot=yes
1.4, Ethtool tool DiagnosticsEthtool-p eno1: Corresponding to the screen flashing Ethtool eno1: View network card information
configuration (Linux network adapter configuration and binding)

Redhat Linux Network configuration, basically by modifying several configuration files to achieve, although can also use Ifconfig to set IP, with route to configure the default gateway, with hostname to configure the hostname, but restart will be lost.

Related configuration Files

/ect/hosts Configure host name and IP address correspondence

/etc/sysconfig/network Configure host names and gateways

/etc/sysconfig/network-scripts/ifcfg-eth0 eth0 configuration file, eth1 file name is ifcfg-eth1, etc. 2.1, NIC configuration

Let's say we want to configure the IP address 192.168.168.1/24 with host name Test,eth0, gateway address 192.168.168.250

The contents of the/etc/sysconfig/network file are as follows:

Networking=yes
Hostname=test
gateway=192.168.168.250

Eth0 the corresponding configuration file/etc/sysconfig/network-scripts/ifcfg-eth0 the contents as follows:

Hwaddr=
Type=ethernet
Defroute=yes
Peerdns=yes
Peerroutes=yes
Ipv4_failure_fatal=no
Ipv6init=yes
Ipv6_autoconf=yes
Ipv6_defroute=yes
Ipv6_peerdns=yes
Ipv6_peerroutes=yes
Ipv6_failure_fatal=no
Name=eno1
Uuid=e5a7d38e-41dd-4d7e-9250-829d87384d24
Onboot=yes
Ipaddr=
gateway=
dns1= bootproto=static Note: Sometimes hwaddr and ifconfig inconsistencies cause the service to be restarted network restart
2.2 Single NIC binding multiple IP

Sometimes we need to configure multiple IPs on a single network card, for example, in the above example, we also need to configure IP 192.168.168.2 and 192.168.168.3 for eth0. Then you will need to create two new profiles under/etc/sysconfig/network-scripts:


more than 2.3 network adapters are bundled into a single virtual network card

In order to provide high availability of the network, we may need to bind multiple network cards into a single virtual NIC to provide services, so that even if one of the physical network card fails, it will not cause the connection to be interrupted. For example, we can bind eth0 and eth1 to a virtual NIC Bond0
References: < http://www.cnblogs.com/dkblog/archive/2011/08/30/2160204.html>

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.