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.

RHCSA7: Task of the day

Allowed time: 10 minutes.
Create an EXT4 file system mounted by UUID in /etc/fstab under /vol based on a logical volume of 28 logical extents.

RHCE7: Task of the day

Allowed time: 10 minutes.
Change the SSH process configuration to only listen on the 443 port.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...