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