Guest User

Untitled

a guest
Feb 11th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. iptables -t nat -A PREROUTING -p tcp -d x.x.x.a --dport 9750 -j DNAT --to-destination x.x.x.b:9750
  2. iptables -t nat -A POSTROUTING -p tcp --dport 9750 -j MASQUERADE
  3.  
  4. cat /etc/sysctl.conf |grep forward
  5. # Uncomment the next line to enable packet forwarding for IPv4
  6. net.ipv4.ip_forward=1
  7. # Uncomment the next line to enable packet forwarding for IPv6
  8. #net.ipv6.conf.all.forwarding=1
  9.  
  10. echo 1 >/proc/sys/net/ipv4/ip_forward
  11.  
  12. net.ipv4.ip_forward=1
  13.  
  14. iptables -A PREROUTING -t nat -i [external_iface] -p [proto] --dport [external_port] -j DNAT --to [internal_ip]:[internal_port]
  15. iptables -A FORWARD -p [proto] -d [internal_ip] --dport [internal_port] -j ACCEPT
Add Comment
Please, Sign In to add comment