Advertisement
Guest User

usr13

a guest
Aug 5th, 2011
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. 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:
  2.  
  3. sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
  4.  
  5. You will also need to enable IP forwarding. You can do this temporarily, using the following command:
  6.  
  7. sudo echo 1 > /proc/sys/net/ipv4/ip_forward
  8.  
  9. Then set up your inside NIC
  10.  
  11. Set it to a static IP address like so:
  12.  
  13. sudo ifconfig eth0 192.168.3.1
  14.  
  15. At that point, (if you don't care to set up dhcp server and caching nameserver):
  16.  
  17. Connect the client machine and set it's IP, something like: 192.168.3.2
  18. Make it's default rout 192.168.3.1
  19. 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