Wednesday, June 26, 2013

IPTABLES NAT Rule Implementation

Friend,

Recently my network Admin has blocked Facebook access to all our Desktop-PC.

But fortunately I have access of one of Linux system where then haven’t implemented firewall rule.

So I MASQUERADE my outgoing traffic from my PC to that Linux System to get Facebook Access. J

It’s Very easy & if you want you could also test this on your Lab.

Example: - My PC (eth0: 172.24.40.110)

Linux PC [eth0: 172.24.40.120 (Lan Interface) eth1: 10.10.20.1 (Wan Interface)]

Step 1) On My PC (eth0: 172.24.40.110) set “Default Gatway to Linux machine(eth0: 172.24.40.120)

Step 2) On Linux machine set IP Forwarding

[root@station-y ]#vi /etc/sysctl.conf
net.ipv4.ip_forward = 1

Step 3) Apply NAT rule to MASQUERADE all traffic to eth1 (Wan Interface)


[root@station-y ]# iptables -t nat -I POSTROUTING -s 172.24.40.0/24 -o eth1 -j MASQUERADE

No comments:

Post a Comment

Renew k8s certificates

Check If certificate expires: amikum@~:03:06:54(⎈ |local-cluster:default):sudo kubeadm certs check-expiration CERTIFICATE                EXP...