0

How to permanently add route IP address in linux For static/temporary adding of IP address in route I am using route add -net "DESTINATION_IP" netmask gw

1 Answer 1

0

When you say 'permanently', I assume you mean across boots. It really depends on the specific distribution of Linux as to how to do this.

2
  • To add permanent static routes to a system, create a file /etc/sysconfig/network-scripts/route-eth0 (or whichever interface you want to route through). We can add as many routes as we like by simply incrementing the number at the end of each statement. Once saved a restart of network services will force a read of this route file. The syntax of the file should look like this: ADDRESS0=x.x.x.x GATEWAY0=x.x.x.x NETMASK0=x.x.x.x ADDRESS1=x.x.x.x GATEWAY1=x.x.x.x NETMASK1=x.x.x.x But I do not find any file name like route-eth0 but I have ifcfg-eth0 route-bond0 route6-bond0 ifcfg-bond0
    – Aryan
    Commented May 9, 2015 at 20:03
  • Hey @Aryan it would be better for the OP to put that in your own answer and format it correctly.
    – Otheus
    Commented May 9, 2015 at 20:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .