These are the Iptable rules required for port forwarding xxx.xxx.xxx.xxx:8888 to 192.168.0.2:80
/sbin/iptables -t nat -A PREROUTING -p tcp -i eth0 -d xxx.xxx.xxx.xxx
–dport 8888 -j DNAT –to 192.168.0.2:80
/sbin/iptables -A FORWARD -p tcp -i eth0 -d 192.168.0.2 –dport 80 -j ACCEPT
# iptables -t nat -L
Here rdp 75.144.218.185:13389 will forward to 192.168.1.5 port 3389 here 3389 is rdp port
/etc/sysconfig/iptables
-A PREROUTING -d 75.144.218.185 -i eth1 -p tcp -m tcp –dport 13389 -j DNAT –to-destination 192.168.1.5:3389
-A PREROUTING -d 75.144.218.185 -i eth1 -p tcp -m tcp –dport 80 -j DNAT –to-destination 192.168.1.5:8
Howto disable the iptables firewall in Linux
Task: Disable / Turn off Linux Firewall (Red hat/CentOS/Fedora Core)
Type the following two commands (you must login as the root user):
# /etc/init.d/iptables save
# /etc/init.d/iptables stop
Task: Enable / Turn on Linux Firewall (Red hat/CentOS/Fedora Core)
Type the following command to turn on iptables firewall:
# /etc/init.d/iptables start
Other Linux distribution
If you are using other Linux distribution such as Debian / Ubuntu / Suse Linux etc, try following generic procedure.
Save firewall rules
# iptables-save > /root/firewall.rules
OR
$ sudo iptables-save > /root/firewall.rules
Now type the following commands (login as root):
# iptables -X
# iptables -t nat -F
# iptables -t nat -X
# iptables -t mangle -F
# iptables -t mangle -X
# iptables -P INPUT ACCEPT
# iptables -P FORWARD ACCEPT
# iptables -P OUTPUT ACCEPT
To restore or turn on firewall type the following command:
# iptables-restore < /root/firewall.rules
Subscribe to:
Post Comments (Atom)
kubernetes Pod Scheduling
=================== Deployment ================= 1.) Deployment without any nodeName or nodeSelector, pod will spread among all of the av...
-
# Ansible module and some advance options Modules: Command: This module help you to execute commands to the target host, it may be comma...
-
# Using Facts, in ansible playbook [root@ansimaster:~/ansiroot/playbook]# vi playbook1_remote_facts.yml --- - name: Playbook that wil...
-
Create user using vault [ansible@ansiblemaster playbooks]$ cat inventory [webserver] web1.mylinuxfriends.blogspot.com [dbserver]...
No comments:
Post a Comment