Linux service configuration-linux system route configuration

Source: Internet
Author: User
I. network-related commands in linux: the network configuration file is in etcsysconfignetwork-scr


1. network-related commands in linux: the network configuration file is in/etc/sysconfig/network-scripts.

Mii-tool-v.

Ethtool

Lscpu, lsusb, lsblk, and lspci-v to view information about each hardware.


1. ifconfig eth0 ip_address netmask net_mask modify the IP address and subnet mask of the NIC

2. ifconfig eth0 ip_address/24 configure the IP address and subnet mask

3. ifconfig eth0 down/up disable Nic, do not reload Nic configuration file/etc/sysconfig/network-scripts/ifcfg-eth0

4. ifconfig eth0 hw ether MAC_Address configure MAC address

5. ifconfig eth0: 1 IP_Address: configure the virtual network interface

6. configure the wireless network card in iwconfig.


7. View arp tables through arp-n

8. arp-s Ip_address Mac_address static binding MAC address


9. view the route table in route-n

10. traceroute

2. configure the linux system as a router:

1. enable route forwarding:

A. The routing and forwarding function of sysctl-w net. ipv4.ip _ forward = 1 is temporarily valid and cannot be restarted.

B. echo 1>/proc/sys/net/ipv4/ip_forward is temporarily valid and suitable for scripts.

C. modify the/etc/sysctl. conf file and change the variable value of net. ipv4.ip _ forward to 1. then enter sysctl-p to restart the configuration file.

2. add default routes and static routes

A. route add default gw IP_address add a default route.

B. delete the default route using route del default

C. route add-net network address gw IP_address add a static route.

D. route del-net network address gw Ip_address delete static route

E. vi/etc/sysconfig/network-scipts/route-eth0 and then add the static routing format in the file as follows:

Network/24 via IP_address is a permanent static route.

III. Solution to failure of Nic cloning for virtual machines.

1. clear the/etc/udev/rules. d/70-persistent-net.rules file.

2. delete the/etc/sysconfig/network-scipts/ifcfg-ethX file.

3. add a new NIC



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.