Problem
Adding a static route to a different subnet that cannot be accessed through your default gateway.
Solution
To add a temporary route:
1 |
ip route add 172.16.5.0/24 via 10.0.0.101 dev eth0 |
To make it persist system or network settings restart, create a route-ifname file for an interface through which the subnet is accessed, in this case eth0:
1 |
nano /etc/sysconfig/network-scripts/route-eth0 |
Add the line with the network settings for the other subnet:
1 |
172.16.5.0/24 via 10.0.0.101 dev eth0 |
Restart network service
1 |
/etc/init.d/network restart |