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 program. |
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. |
Add static route using “route add”:
|
# route add -net 192.168.100.0 netmask 255.255.255.0 gw 192.168.1.1 dev eth0
|
If you want persistent static route, you need to edit /etc/sysconfig/network-scripts/route-eth0 file to define static routes for eth0 interface. |
# vim /etc/sysconfig/network-scripts/route-eth0 |
GATEWAY0=192.168.1.1
|
NETMASK0=255.255.255.0
|
ADDRESS0=192.168.100.0
|
Save and close the file. Restart networking: |
# service network restart
|
Verify new routing table by, |
# route –n or # netstat –nr |
route add in Linux
Subscribe to:
Post Comments (Atom)
cheers man this helped alot especially the last part.
ReplyDeleteRoute Add In Linux >>>>> Download Now
ReplyDelete>>>>> Download Full
Route Add In Linux >>>>> Download LINK
>>>>> Download Now
Route Add In Linux >>>>> Download Full
>>>>> Download LINK Il