Linux route command practice, linuxroute

Source: Internet
Author: User

Linux route command practice, linuxroute

Configure the route table:

Step 1:

Sudo route add-net 172.30.6.0 netmask limit 255.0 eth0

After the command is executed, run the route-n command to view the information as follows:

172.30.6.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

This step enables communication between the LAN, but cannot communicate with the Internet through the vro 172.30.6.1

Parameter Parsing in the command line:

Add: Indicates adding route information.

-Net: indicates the network number following the network number. In this example, the network number is 172.30.6.0.

Netmask: indicates the subnet mask, followed by 255.255.255.0.

Eth0: indicates which device to set

Step 2:

Sudo route add default gw 172.30.6.1 eth0

After execution, you can use route-n to view the information as follows:

0.0.0.0 172.30.6.1 0.0.0.0 UG 0 0 0 eth0

This step enables the local machine to communicate with the Internet through the vro17172.30.6.1

Now you can access the Internet !!! (If you have any questions, please reply)

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.