route -p add 192.168.160.0 172.30.14.1
In the above example 192.168.160.0 is the destination gateway IP
and 172.30.14.1 source gateway IP
-p is used to avoid restart of the server. It will change the value with out restarting the server .
Here we are trying to add persistent route to access an IP in the gateway 192.168.160.0 and our source or server IP (172.30.14.91)is in the gateway 172.30.14.1
route -p delete 10.14.1.204 172.30.15.1 -netmask 255.255.255.0
Other usefull command are given below
# netstat -nr
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
default 172.30.14.1 UG 3 12623
10.10.71.68 172.30.14.1 UGH 2 8
127.0.0.1 127.0.0.1 UH 2 27918 lo0
169.254.182.0 169.254.182.77 U 2 5087 net2
172.30.14.0 172.30.14.91 U 6 20 net1
172.30.15.0 172.30.14.1 UGH 1 0
172.30.16.0 172.30.16.121 U 10 3492312 net0
192.168.160.0 172.30.14.1 UG 2 2911
Routing Table: IPv6
Destination/Mask Gateway Flags Ref Use If
--------------------------- --------------------------- ----- --- ------- -----
==========================================================================
# route -p show
persistent: route add default 172.30.14.1
persistent: route add 10.10.71.68 172.30.14.1
persistent: route add 172.30.15.0 172.30.14.1
persistent: route add 192.168.160.0 172.30.14.1
==========================================================
# traceroute 10.14.1.204
traceroute: Warning: Multiple interfaces found; using 172.30.14.91 @ net1
traceroute to 10.14.1.204 (10.14.1.204), 30 hops max, 40 byte packets
1 172.30.14.1 (172.30.14.1) 0.519 ms !X * 0.598 ms !X
====================================================================
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment