LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-04-2010, 01:06 PM   #1
traderbam
LQ Newbie
 
Registered: Sep 2009
Posts: 8

Rep: Reputation: 0
Bridged VPN with two NICs


I need a little guidance as to the best way to approach this. Thanks!

My brother has a Ubuntu server attached to a LAN with Windows PCs. I set up an openVPN tun service on the server, let's call this VPN1, so that I can connect remotely from my Ubuntu desktop. The server has one NIC and the LAN has a router that is the gateway to the internet.

My brother would like to remotely access his windows network when roaming with his Windows laptop. Therefore, I would like to set up a second VPN service, this time tap, that is bridged with his LAN. Let's call this VPN2.

The LAN subnet is 192.168.1.0/24. The internet gateway is 192.168.1.1
The NIC has a fixed IP set by the router of 192.168.1.150

How do I set up VPN2 so as not to trash VPN1? That is, if I bridge eth0 with tap0 how will that impact VPN1's tun0 that is using eth0? Do I need a separate NIC for the VPN2 bridge? Am I asking the right questions?

Brian

Last edited by traderbam; 06-04-2010 at 01:07 PM.
 
Old 06-04-2010, 06:19 PM   #2
traderbam
LQ Newbie
 
Registered: Sep 2009
Posts: 8

Original Poster
Rep: Reputation: 0
It looks like I was able to figure this out, or one way to do it anyhow. Quite tricky.

I added another NIC. I then had to change the OS routing table and configure the interfaces (as root):
route add -net 192.168.1.1/32 dev eth0
route add default gw 192.168.1.1 dev eth0
ifconfig eth0 192.168.1.150
ifconfig eth1 0.0.0.0 promisc up
openvpn --mktun --dev tap0
ifconfig tap0 0.0.0.0 promisc up
brctl addbr bridge0
brctl addif tap0
brctl addif eth1
ifconfig bridge0 192.168.1.152 netmask 255.255.255.0 broadcast 192.168.1.255

This is the basic set up. eth0 is used for routing internet gateway packets and packets that are not dealt with by bridge0. bridge0 handles the LAN traffic and VPN2 traffic. The original VPN1 operates unimpeded through eth0 using a tun interface.

sudo openvpn --config bridgedServer.conf &

Unexpected PROBLEM:
When I started rerouting things, Ubuntu's Network Manager began undoing my changes. I had to find out how to stop NM and this was tricky so I took the precaution of uninstalling it.

I also had problems with eth1 interfering with eth0. So it is important to configure the cards in /etc/network/interfaces so that everything boots up without conflict.

I need to create a convenient shell script to set up the tap and bridge and start openvpn, and another to shut it all down again.
 
  


Reply



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
Bonded NICs at host OS (Ubuntu Server) bridged to virtual OS (UServ) in VMware server Xiiph Linux - Networking 1 10-21-2009 01:04 PM
bridged VPN using openvpn -- cannot access anything on LAN incl. server scheidel21 Linux - Networking 1 04-14-2009 03:51 PM
Trying to configure shorewall to allow bridged vpn traffic to the local subnet perlchun Linux - Networking 4 06-25-2008 09:13 PM
Intel D845GLLY + Multiple Intel Pro 100 NICs + kernel 2.6.x = NICs don't work egable Linux - Hardware 0 02-04-2005 02:30 PM
vmware bridged network homestead1000 Linux - Networking 1 01-21-2004 04:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:46 AM.

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