linux配置端口映射
if [ -z "`iptables -t nat -L | grep REDIRECT | grep udp | grep 10162`" ]; then iptables -t nat -A PREROUTING -p udp -m udp --dport 162 -j REDIRECT --to-ports 10162 fi chmod +x /etc/init.d/boot.local sed -i '/iptables -t nat -A PREROUTING -p udp -m udp --dport 162 -j REDIRECT --to-ports 10162/d' /etc/init.d/boot.local sed -i '$a\iptables -t nat -A PREROUTING -p udp -m udp --dport 162 -j REDIRECT --to-ports 10162' /etc/init.d/boot.local
while [ -n "`iptables -t nat -L | grep REDIRECT | grep udp | grep 10162`" ]; do iptables -t nat -D PREROUTING -p udp -m udp --dport 162 -j REDIRECT --to-ports 10162 >/dev/null 2>&1 done sed -i '/iptables -t nat -A PREROUTING -p udp -m udp --dport 162 -j REDIRECT --to-ports 10162/d' /etc/init.d/boot.local
相关推荐
linuxvfast 2018-03-20
wwater 2011-05-07
missingmuch 2020-05-26
仁鱼 2020-02-12
DumbbellYang 2020-05-07
xx0cw 2020-05-07
SZStudy 2020-04-21
diediexiaomi 2020-04-10
安得情怀似旧时 2020-03-04
OwenJi 2020-01-17
xx0cw 2019-12-13
Lovexinyang 2019-11-17
Jesuslovesme 2010-05-05
LeoHan 2015-08-11
linux爱好者 2010-11-18
thlm0 2019-10-21
batoom 2011-09-23
Fangxingt 2019-04-10