This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Thursday, November 16, 2017

How to add temporary & permanent route in Linux box?

Follow the below steps for adding the route as  temporary or permanent . 

Temporary Route

We just need to add the ip route add command in command line. like below

[root@testserver ~]#ip route add via dev eth0

[root@testserver ~]# route -n | grep -i UG    0      0        0 eth0

Above route entry will be invicible post reboot the linux box.

Permanent Route

We need to create a file route-eth0 (since it is pointing eth0 device) under /etc/sysconfig/network-scripts/ path & add the below entry.

[root@testserver network-scripts]# cat route-eth0 via dev eth0

save & exit.

Route will be persistent after every reboot of the Linux box.

Note : Permanent route need  network interface.reload for immediate effect.

Hope it helps.

No comments:

Post a Comment