读书人

Redirect port from 8080 to 80 in li

发布时间: 2013-10-14 12:54:46 作者: rapoo

Redirect port from 8080 to 80 in linux server(1)

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

查看配置是否成功
# iptables -t nat -L


Chain PREROUTING (policy ACCEPT)
target prot opt source destination
REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 8080

记住最后要save
iptables-save

移除重定向
# iptables -t nat -D PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

读书人网 >UNIXLINUX

热点推荐