标签: linux redirect ssh firewall iptables
我有可执行文件,它尝试连接到不存在的10.5.5.100:22(ssh)地址。我想使用localhost:22将该流量重定向到iptables。
10.5.5.100:22
localhost:22
iptables
答案 0 :(得分:2)
使用REDIRECT目标:
iptables -t nat -A OUTPUT -p tcp -d 10.5.5.100 --dport 22 -j REDIRECT
这会将数据包发送回主网络接口。
来源:http://linux.die.net/man/8/iptables