SYS: Use iptables to implement packet filtering and configure network address translation (NAT).

Share this link

To implement NAT on a server with two network cards (eth0:192.168.1.1/24 connected to the Internet and eth1:192.168.2.1/24 connected to the internal network) several steps are required.

Edit the /etc/sysctl.conf file and assign 1 to the ‘net.ipv4.ip_forward‘ option:

net.ipv4.ip_forward = 1

Update the system:

# sysctl -p

Add a new rule to the firewall:

# iptables -t nat -I POSTROUTING -o eth0 -s 192.168.2.0/24 -j MASQUERADE

Save the firewall configuration:

# service iptables save
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 4.00 out of 5)
Loading...

Leave a Reply

Be the First to Comment!

Notify of
wpDiscuz

RHCSA7: Task of the day

Allowed time: 10 minutes.
Create two new user accounts "steve" and "oliver".
Create a group "team". Create a directory "shared".
All files put into the "shared" directory by "steve" or "oliver" should belong to the "team" group and be only visible by them.

RHCE7: Task of the day

Allowed time: 10 minutes.
Set up a caching-only DNS server.

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