Advertisement
mightymouse2045

Man ip route add vs man route add

Dec 13th, 2013
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.68 KB | None | 0 0
  1.  
  2. Man ip route add:
  3.  
  4. Synopsis:
  5. ip route { add | del | change | append | replace } ROUTE
  6.  
  7.        SELECTOR := [ root PREFIX ] [ match PREFIX ] [ exact PREFIX ] [ table TABLE_ID ] [ proto RTPROTO ] [ type TYPE ] [ scope SCOPE ]
  8.  
  9.        ROUTE := NODE_SPEC [ INFO_SPEC ]
  10.  
  11.        NODE_SPEC := [ TYPE ] PREFIX [ tos TOS ] [ table TABLE_ID ] [ proto RTPROTO ] [ scope SCOPE ] [ metric METRIC ]
  12.  
  13.        INFO_SPEC := NH OPTIONS FLAGS [ nexthop NH ] ...
  14.  
  15.        NH := [ via ADDRESS ] [ dev STRING ] [ weight NUMBER ] NHFLAGS
  16.  
  17.        OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ] [ rtt TIME ] [ rttvar TIME ] [ reordering NUMBER ] [ window NUMBER ] [ cwnd NUMBER ] [ ssthresh REALM ] [ realms REALM ] [ rto_min TIME ] [ initcwnd NUMBER ] [ initrwnd NUMBER
  18.                ] [ quickack BOOL ]
  19.  
  20.        TYPE := [ unicast | local | broadcast | multicast | throw | unreachable | prohibit | blackhole | nat ]
  21.  
  22.        TABLE_ID := [ local| main | default | all | NUMBER ]
  23.  
  24.        SCOPE := [ host | link | global | NUMBER ]
  25.  
  26.        NHFLAGS := [ onlink | pervasive ]
  27.  
  28.        RTPROTO := [ kernel | boot | static | NUMBER ]
  29.  
  30.  
  31. Description
  32.  
  33. ip route add
  34.               add new route
  35.  
  36. Example
  37.  
  38.        ip route add default via 192.168.1.1 dev eth0
  39.            Adds a default route (for all addresses) via the local gateway 192.168.1.1 that can be reached on device eth0.
  40.  
  41.  
  42.  
  43. Man route add:
  44.  
  45. SYNOPSIS
  46.        route  [-v] [-A family |-4|-6] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If]
  47.  
  48. DESCRIPTION
  49. Route manipulates the kernel's IP routing tables.  Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured with the ifconfig(8) program.
  50.  
  51.       When the add or del options are used, route modifies the routing tables.  Without these options, route displays the current contents of the routing tables.
  52.  
  53. OPTIONS
  54. Concise and to the point descriptions for each option
  55.  
  56. EXAMPLES (Lots of them!!)
  57.       route add -net 127.0.0.0 netmask 255.0.0.0 dev lo
  58.              adds the normal loopback entry, using netmask 255.0.0.0 and associated with the "lo" device (assuming this device was previously set up correctly with ifconfig(8)).
  59.  
  60.       route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
  61.              adds a route to the local network 192.56.76.x via "eth0".  The word "dev" can be omitted here.
  62.  
  63.       route del default
  64.              deletes the current default route, which is labeled "default" or 0.0.0.0 in the destination field of the current routing table.
  65.  
  66.       route add default gw mango-gw
  67.              adds a default route (which will be used if no other route matches).  All packets using this route will be gatewayed through "mango-gw". The device which will actually be used for that route depends on how we can reach
  68.              "mango-gw" - the static route to "mango-gw" will have to be set up before.
  69.  
  70.       route add ipx4 sl0
  71.              Adds the route to the "ipx4" host via the SLIP interface (assuming that "ipx4" is the SLIP host).
  72.  
  73.       route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4
  74.              This command adds the net "192.57.66.x" to be gatewayed through the former route to the SLIP interface.
  75.  
  76.       route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
  77.              This is an obscure one documented so people know how to do it. This sets all of the class D (multicast) IP routes to go via "eth0". This is the correct normal configuration line with a multicasting kernel.
  78.  
  79.       route add -net 10.0.0.0 netmask 255.0.0.0 reject
  80.              This installs a rejecting route for the private network "10.x.x.x."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement