Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- To set up Network Address Translation (NAT) on a gateway machine, so that other machines on your network can access the Internet through it. You can use the following rule to do this:
- sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
- You will also need to enable IP forwarding. You can do this temporarily, using the following command:
- sudo echo 1 > /proc/sys/net/ipv4/ip_forward
- Then set up your inside NIC
- Set it to a static IP address like so:
- sudo ifconfig eth0 192.168.3.1
- At that point, (if you don't care to set up dhcp server and caching nameserver):
- Connect the client machine and set it's IP, something like: 192.168.3.2
- Make it's default rout 192.168.3.1
- Give it nameservers (as provided by your ISP, or just use 4.2.2.2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement