Last active
August 29, 2015 14:06
-
-
Save tuoxie007/ce46900f14490be8f82d to your computer and use it in GitHub Desktop.
linux-config-port-mirror
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local_ip= | |
local_port= | |
remote_ip= | |
remote_port= | |
iptables -t nat -A PREROUTING -d $local_ip -p tcp --dport $local_port -j DNAT --to-destination $remote_ip:$local_port | |
iptables -t nat -A POSTROUTING -d $remote_ip -p tcp --dport $remote_port -j SNAT --to $local_ip | |
iptables -A FORWARD -o eth1 -d $remote_ip -p tcp --dport $remote_port -j ACCEPT | |
iptables -A FORWARD -i eth1 -s $remote_ip -p tcp --sport $remote_port -j ACCEPT | |
iptables -vnL --line-numbers | |
iptables -D FORWARD 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment