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.
Boot and change the root password before the end of the boot process.

RHCE7: Task of the day

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

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

Recent Comments