Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. iptables --flush
  2. iptables --table nat --flush
  3. iptables --delete-chain
  4. iptables --table nat --delete-chain
  5.  
  6. iptables --table nat --append POSTROUTING --out-interface tun0 -j MASQUERADE
  7. iptables --append FORWARD --in-interface tun0 -j ACCEPT
  8. echo 1 > /proc/sys/net/ipv4/ip_forward
  9.  
  10. iptables -t nat -A PREROUTING -p tcp -m tcp --dport 554 -j DNAT --to-destination 10.9.0.6
  11. iptables -t nat -A PREROUTING -p udp -m udp --dport 554 -j DNAT --to-destination 10.9.0.6
  12. iptables -t nat -A POSTROUTING -d 10.9.0.6 -p tcp -m tcp --dport 554 -j MASQUERADE
  13. iptables -t nat -A POSTROUTING -d 10.9.0.6 -p udp -m udp --dport 554 -j MASQUERADE
  14. iptables -I FORWARD -i tun0 -p udp -d 10.9.0.6 --dport 554 -j ACCEPT
  15. iptables -I FORWARD -i tun0 -p tcp -d 10.9.0.6 --dport 554 -j ACCEPT
  16. iptables -t nat -I PREROUTING -i tun0 -p tcp --dport 554 -j DNAT --to-destination 10.9.0.6
  17. iptables -t nat -I PREROUTING -i tun0 -p udp --dport 554 -j DNAT --to-destination 10.9.0.6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement