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

Upcoming Events (CET)

There are no events.

RHCSA7: Task of the day

Allowed time: 5 minutes.
Add 100MB of swap space to the machine using a new logical volume.

RHCE7: Task of the day

Allowed time: 15 minutes.
Configure a Samba server called MYSERVER, belonging to the MYGROUP group, sharing the /shared directory with the name "shared".

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