Commit fbc4e96d authored by nanahira's avatar nanahira

multiport

parent d2c959dc
#!/bin/bash #!/bin/bash
sudo iptables -t nat -A PREROUTING -m addrtype --dst-type LOCAL -p tcp -m tcp --dport $1 -j DNAT --to-destination $2 sudo iptables -t nat -A PREROUTING -m addrtype --dst-type LOCAL -p tcp -m multiport --dports $1 -j DNAT --to-destination $2
sudo iptables -t nat -A PREROUTING -m addrtype --dst-type LOCAL -p udp -m udp --dport $1 -j DNAT --to-destination $2 sudo iptables -t nat -A PREROUTING -m addrtype --dst-type LOCAL -p udp -m multiport --dports $1 -j DNAT --to-destination $2
cp ./ipt ./ipt.bak cp ./ipt ./ipt.bak
sudo iptables-save > ./ipt sudo iptables-save > ./ipt
#netfilter-persistent save #netfilter-persistent save
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment