Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- iptables -t nat -A PREROUTING -p tcp -d x.x.x.a --dport 9750 -j DNAT --to-destination x.x.x.b:9750
- iptables -t nat -A POSTROUTING -p tcp --dport 9750 -j MASQUERADE
- cat /etc/sysctl.conf |grep forward
- # Uncomment the next line to enable packet forwarding for IPv4
- net.ipv4.ip_forward=1
- # Uncomment the next line to enable packet forwarding for IPv6
- #net.ipv6.conf.all.forwarding=1
- echo 1 >/proc/sys/net/ipv4/ip_forward
- net.ipv4.ip_forward=1
- iptables -A PREROUTING -t nat -i [external_iface] -p [proto] --dport [external_port] -j DNAT --to [internal_ip]:[internal_port]
- iptables -A FORWARD -p [proto] -d [internal_ip] --dport [internal_port] -j ACCEPT
Add Comment
Please, Sign In to add comment