Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -A PREROUTING -d [interal ip] -p tcp -m tcp --dport 80 -j DNAT --to-destination [client_internal_ip]
- -A PREROUTING -d [interal ip] -p tcp -m tcp --dport 443 -j DNAT --to-destination [client_internal_ip]
- -A POSTROUTING -p tcp -m tcp --dport 80 -j MASQUERADE
- -A POSTROUTING -p tcp -m tcp --dport 443 -j MASQUERADE
- --get traffic back
- iptables -t nat -A POSTROUTING -p tcp -d [client_internal_ip] --dport 80 -j SNAT --to-source [internal ip]
- iptables -t nat -A POSTROUTING -p tcp -d [client_internal_ip] --dport 80 -j SNAT --to-source [internal ip]
- Explain:
- ----This rule will forward 80 port to 192.168.42.10
- iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.168.42.10:80
- ---but this is not enough If you want to get back traffic then you should add this rule
- iptables -t nat -A POSTROUTING -p tcp -d 192.168.42.10 --dport 80 -j SNAT --to-source 192.168.42.1
- where ip address 192.168.42.1 is your iptables computer
- These two rules have to solve the task.
Advertisement
Add Comment
Please, Sign In to add comment