SYS: Route IP traffic and create static routes.

Share this link

To set up a default route going through the eth0 interface, edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file and put the destination address (here 192.168.1.1) into the GATEWAY variable:

GATEWAY=192.168.1.1

Restart the network service:

# service network restart

Check the configuration:

# route -n

To add a static route going through the eth0 interface to 192.168.0.0/24 via 192.168.2.1, create the /etc/sysconfig/network-scripts/route-eth0 file and add the following lines:

ADDRESS0=192.168.0.0
NETMASK0=255.255.255.0
GATEWAY0=192.168.2.1

Restart the network service:

# service network restart

Check the configuration:

# route -n
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Leave a Reply

Upcoming Events (Local Time)

There are no events.

Follow me on Twitter

Archives