Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 05-28-2009, 11:19 PM   #1
LQ Newbie
Registered: Nov 2006
Posts: 8

Rep: Reputation: 0
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!

Last edited by davidolaj; 05-28-2009 at 11:24 PM.
Old 05-29-2009, 12:33 AM   #2
LQ Newbie
Registered: Nov 2004
Posts: 17

Rep: Reputation: 0
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with the VPN internet connection Deadw Slackware 1 04-01-2008 04:03 PM
Can not share internet connection bradshoults Linux - Networking 3 08-15-2007 10:10 PM
VPN connection with my internet provider kruvalig Fedora 5 08-01-2007 01:08 AM
making VPN internet connection mohtasham1983 Linux - Newbie 3 09-27-2005 02:13 PM
Share VPN connection eplegutt Linux - Networking 0 02-18-2004 05:27 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration