I have a LAN at home.
- One Netgear router - 192.168.0.1 connected to the internet.
- One Macbook - 192.168.0.10 (connected to Netgear router)
- One PC with Kali Linux - 192.168.0.20 (connected to Netgear too)
I'm trying to route all Macbook traffic through the PC. So I set the network settings on my Macbook proxy-server address - 192.168.0.20 (PC). I have no problems with this - all packets go to the PC (through Netgear router of course). Its okay. but..
How to manage the NAT table on Linux to route Macbook's traffic to the router (and so to the internet)?
I tried to do something like this, but it doesn't work correctly:
iptables -t nat -A PREROUTING -s 192.168.0.10 -j DNAT --to-destination 192.168.0.1 iptables -t nat -A POSTROUTING -s 192.168.0.10 -j SNAT --to-source 192.168.0.20
with this settings I have BAD REQUEST 400 in my browser on Mac.