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

Be the First to Comment!

Notify of
wpDiscuz

RHCSA7: Task of the day

Allowed time: 3 minutes.
Check that you've got no SELinux policy violations.

RHCE7: Task of the day

Allowed time: 8 minutes.
Set up an iScsi target based on a fileio backstore of 100MB called /opt/shareddata with CHAP authentication (username=usr/password=pwd), xfs filesystem and standard firewall configuration.

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 ...