Skip to content

Instantly share code, notes, and snippets.

@aesthetic-zz
Created April 15, 2011 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aesthetic-zz/ac204863852442131aca to your computer and use it in GitHub Desktop.
Save aesthetic-zz/ac204863852442131aca to your computer and use it in GitHub Desktop.
iptable
:~$ sudo iptables -A PREROUTING -i eth0 -p tcp -m tcp --dport 21 -j REDIRECT --to-ports 10021
iptables: No chain/target/match by that name.
:~$ sudo iptables -t filter -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:bootps
ACCEPT tcp -- anywhere anywhere tcp dpt:bootps
ACCEPT tcp -- anywhere anywhere tcp spt:5555 dpt:5555
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere 192.168.122.0/24 state RELATED,ESTABLISHED
ACCEPT all -- 192.168.122.0/24 anywhere
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
REJECT all -- anywhere anywhere reject-with icmp-port-unreachable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment