June 21, 2014

Static Routes with RHEL 6

The new way to add static routes in RHEL 6 is

$ vi /etc/sysconfig/network-scripts/route-<interface>

ADDRESS0=X.X.X.X
NETMASK0=X.X.X.X
GATEWAY0=X.X.X.X

Or alternative via the old ip command style.

$ vi /etc/sysconfig/network-scripts/route-<interface>

X.X.X.X/Y via X.X.X.X dev <interface>

And to set the default gateway.

$ vi /etc/sysconfig/network
...
GATEWAY=X.X.X.X
...

No comments: