Linux route commands

Add a Host route

route add -host 169.47.211.142 gw 10.135.249.118

Delete the Host route

route del -host 169.47.211.142 gw 10.135.249.118

Print the routes with DNS Reverse PTR Record

route

example:

vra-lx:~ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
#default 10.135.249.65 0.0.0.0 UG 0 0 0 eth0
8c.7c.0a05.ip4. 10.135.249.118 255.255.255.255 UGH 0 0 0 eth0
10.135.249.64 * 255.255.255.192 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
68.49.c682.ip4. 10.135.249.118 255.255.255.255 UGH 0 0 0 eth0
8e.d3.2fa9.ip4. 10.135.249.118 255.255.255.255 UGH 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 eth0
192.168.10.0 10.135.249.118 255.255.255.0 UG 0 0 0 eth0

Print only the IPs

route -n

example:

vra-lx:~ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.135.249.65 0.0.0.0 UG 0 0 0 eth0
5.10.124.140 10.135.249.118 255.255.255.255 UGH 0 0 0 eth0
10.135.249.64 0.0.0.0 255.255.255.192 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
130.198.73.104 10.135.249.118 255.255.255.255 UGH 0 0 0 eth0
169.47.71.94 10.135.249.118 255.255.255.255 UGH 0 0 0 eth0
169.47.211.142 10.135.249.118 255.255.255.255 UGH 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.10.0 10.135.249.118 255.255.255.0 UG 0 0 0 eth0

Add default gateway or over vRA VAMI

route add default gw 10.10.10.1

         

hferch has written 76 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">