Google

How to config Static Route on Linux

static-route
How to config Static Route on Linux?

Firsts, how to show routing table?, try type following command:

ip route show

OR

netstat -rn

To set default gateway, following command:
route add gw 192.168.1.254

If you want to static an entire network ex: 192.168.10.0/24 , via gw 192.168.1.254

route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.168.1.254 dev eth0

OR

ip route add 192.168.10.0/24 via 192.168.1.254 dev eth0

 

* eth0: this is device network.

*192.168.1.254: this is IP address of device eth0

 

How to config Static Route on Linux
0 votes, 0.00 avg. rating (0% score)