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

Upcoming Events (Local Time)

There are no events.

RHCSA7: Task of the day

Allowed time: 10 minutes.
Create an EXT4 file system mounted under /vol based on a logical volume of 100MB.
Reduce the size to 60MB.

RHCE7: Task of the day

Allowed time: 15 minutes.
Configure a httpd server with a password protected directory under the /var/www/html/private directory.

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