Linux under the route command application

Source: Internet
Author: User

Linux route command detailed
Theory: under Linux default only static routes are supported if no related packages are installed | What RIP protocol OSPF is not supported at all
If you need to make Linux a router in some large projects, you need to turn on forwarding mode
###
Linux#echo1>/proc/sys/net/ip_forward Note: 0 means forwarding is not forwarded for 1 delegates
###

Route Common parameters:
-N: The listed information is displayed by IP (that is, by looking at the routing table)
-add: Increasing routing
-del: Deleting a route
Netmask: Subnet mask for the target network
-net: Increase the routing of a domain
GW: Specifies the gateway for the local network card
Dev: Specify the local network card that is eth0 eth1
---------------------------------------------------------------------------------------------------
Viewing routing information
---------------------------------------------------------------------------------------------------
[Email protected] root]# route
Kernel IP Routing Table
Destination Gateway genmask Flags Metric Ref use Iface
140.116.141.253 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 Lo
Default 140.116.141.253 0.0.0.0 UG 0 0 0 ppp0//Defaults gateway


----------------------------------------------------------------------------------------------------
Add Routing Information
----------------------------------------------------------------------------------------------------
Route add-net 10.103.12.0 netmask 255.255.255.128 gw 10.100.86.49 Dev eth0
----------------------------------------------------------------------------------------------------
Remove Routing information
----------------------------------------------------------------------------------------------------
Route del-net 10.103.12.0 netmask 255.255.255.128 Dev eth0

----------------------------------------------------------------------------------------------------
Specify a default gateway
----------------------------------------------------------------------------------------------------
Route add default GW 192.168.1.2

This article is from the "Lao Han Technical Note" blog, please be sure to keep this source http://hzyan.blog.51cto.com/9617993/1579605

Linux Next route command apply

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.