常用的iptables应用

常用的iptables应用
1、网内机器共享上网
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o ppp+ -j MASQUERADE

2、开放网内服务
iptables -t nat -A PREROUTING -p tcp --dport 8000 -i ppp+ -j DNAT --to-destination 192.168.0.20:8000(如果转发端口不变可省略端口号)

3、端口重定向
iptables -t nat -A PREROUTING -p tcp --dport 8000 -i ppp+ -j redirect 80

你可能感兴趣的:(常用的iptables应用)