LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Share VPN Internet Connection (http://www.linuxquestions.org/questions/linux-networking-3/share-vpn-internet-connection-729224/)

davidolaj 05-28-2009 11:19 PM

Share VPN Internet Connection
 
I have a linux Box (Debian) conected to internet as VPN client. I have extra one ethernet card (eth0) available on the Box which I will like to connect with my LAN hub for my other computers (both Windows and Linux OS) to also have have Internet access.

How can I shared the Box (VPN Internet connection) with the eth0 and how do I enable the Box DHCP to act as Router for all Computers on the LAN?

Please I need HELP here!

orvaquim 05-29-2009 12:33 AM

Well, do you know how yor interface for VPN is identified?

Just run ifconfig to check that. Let us say that it is tun0

Follow this:
i) Ability packet forwarding:
echo 1 > /proc/sys/net/ipv4/ip_forward

ii) Masquerade every machine on your network
iptable -A POSTROUTING -t nat -s x.x.x.x/24 -o tun0 -j MASQUERADE

iii) Copy the DNS servers from
cat /etc/resolv.conf

and place for everyone on your LAN, if they are static otherwise I advice you to configure a only caching DNS server.

Remember, steps i) and ii) must be executed for each reboot. So, for now place those commands on /etc/rc.local.

Good Luck and Hope this will help
Caveman


All times are GMT -5. The time now is 09:08 AM.