Now we need to configure one of the machines as a router, the one with the 3g usb dongle.
- edit /etc/sysctl.conf, set 'net.ipv4.ip_forward = 1'
- enable ip forwarding, 'sysctl -p'
- enable NAT via iptables, 'iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE'
(I'm guessing that your Internet connection is ppp0, replace if incorrect)
- save iptables settings, 'service iptables save'
- in Network Manager ensure the Internet connection is set to connect automatically and is "Available to all users" (this means you won't have to log on to this machine to make the connection active)
- Make a note of the dns settings your router pc picks up when it's connected to the Internet, try looking in /etc/resolv.conf.
On the second (client) machine:
- set the default gateway to be the machine above
- set the dns settings in /etc/resolv.conf to those you noted down above.
- edit /etc/sysctl.conf, set 'net.ipv4.ip_forward = 1'
- enable ip forwarding, 'sysctl -p'
- enable NAT via iptables, 'iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE'
(I'm guessing that your Internet connection is ppp0, replace if incorrect)
- save iptables settings, 'service iptables save'
- in Network Manager ensure the Internet connection is set to connect automatically and is "Available to all users" (this means you won't have to log on to this machine to make the connection active)
- Make a note of the dns settings your router pc picks up when it's connected to the Internet, try looking in /etc/resolv.conf.
On the second (client) machine:
- set the default gateway to be the machine above
- set the dns settings in /etc/resolv.conf to those you noted down above.
No comments:
Post a Comment