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


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.

  • 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 May 9 '15 at 20:03
  • Hey @Aryan it would be better for the OP to put that in your own answer and format it correctly. – Otheus May 9 '15 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.