My Linux Guide
  • Home
Sign in Subscribe

IPtables

A collection of 3 posts
IPtables

Port Forwarding with Iptables

You can use port forwarding in iptables, to forward a port to private ip , here is how you can do that : iptables -t nat -I PREROUTING -p tcp -d <listenip> --dport 22 -j DNAT --to <ipToForwardTo>:22 iptables -I FORWARD -p tcp -d <ipToForwardTo>
Nov 17, 2012
IPtables

Delete Rules in Iptables

iptables -D (Chain Name) ( RuleNum) eg. iptables -D FORWARD 1 You can delete all rules from filter chain by typing : iptables -F or from nat table iptables -F -t nat
Apr 17, 2011
IPtables

Redirecting Ports in Iptables

Redirect ports in iptables iptables -t nat -A PREROUTING -i eth0 -p tcp –dport $srcPortNumber -j REDIRECT –to-port $dstPortNumbe
May 4, 2010
Page 1 of 1
My Linux Guide © 2025
Powered by Ghost