Adding routes
Linux
Display your current routing table
Open the Terminal or login to server using ssh/console. Type the following command to display routing table:
# route
Or
# route -n
Or
# ip route show
Or
# ip route list Adding routes:
Linux add a default route using route command
Route all traffic via 192.168.1.254 gateway connected via eth0 network interface:
# route add default gw 192.168.1.254 eth0
OR
# route add -host {Target host} gw {Gateway IP}
OR Range:
# route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254 Linux add a default gateway (route) using ip command
Route all traffic via 192.168.1.254 gateway connected via eth0 network interface:
Add route via other route:
or
route add –host 172.2.202.20 gw 10.2.202.2
Windows
Open command prompt as administrator
Print routes:
route print
Add route
route ADD 192.168.35.0 MASK 255.255.255.0 192.168.0.2
Remove route:
route delete destination_network
Last updated
Was this helpful?