Welcome to the most active Linux Forum on the web.
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 08-19-2016, 07:59 AM   #1
LQ Newbie
Registered: Oct 2014
Posts: 2

Rep: Reputation: Disabled
VPN attaching to the wrong ethernet when bridging two NIC in Linux

I have problems with my VPN attaching to the wrong NIC, or it just not working when two NIC are present.

My VoIP physical phone is blocked by my ISP so i use an embedded system running Ubuntu 15.04/MATE with two ethernet ports to provide VPN access to the internet on eth0 and the VoIP phone on eth1.

I have established a DHCP Server to provide service to the VoIP phone on eth1 as follows:

Contents of "/etc/dhcp/dhcpd.conf":
ddns-update-style none;
option domain-name "";
option domain-name-servers,;
# Set up our desired subnet:
subnet netmask {
option subnet-mask;
option broadcast-address;
option routers;
default-lease-time 600;
max-lease-time 7200;


Contents of "/etc/network/interfaces":
# The uplink to the internet
auto eth0
iface eth0 inet dhcp

# Assign a static IP for this DHCP server through eth1:
auto eth1
iface eth1 inet static
up route add -host eth1


Contents of "/etc/default/isc-dhcp-server":

To check that the DHCP server is working on eth1 and providing a lease:

$ more /var/lib/dhcp/dhcpd.leases
lease {
starts 4 2016/08/18 15:51:14;
ends 4 2016/08/18 16:01:14;
tstp 4 2016/08/18 16:01:14;
cltt 4 2016/08/18 15:51:14;
binding state active;
next binding state free;
rewind binding state free;
hardware ethernet 7c:2f:80:9c:e0:cb;
client-hostname "C530-IP";

I create a VPN connection and attach it to eth0 using the icon on the desktop

Network Icon->VPN Connections->Configure VPN->VPN->add
(setup gateway, username, password, use Point-to-point encryption, Name VPN1)
Network Icon->VPN Connections->Configure VPN->ethernet->eth0->Edit
(Automatically connect to VPN1 when using this connection, Automatic (DHCP))

Now when the system comes up, the default upstream connection appears as eth1 and not eth0. Trying to connect to the VPN fails.

The network maps is as follows:

$ route -n
Destination Gateway Genmask Flags Metric Ref Use Iface UG 100 0 0 eth1 UG 101 0 0 eth0 UGH 0 0 0 eth1 U 100 0 0 eth0 U 0 0 0 eth1

And the ip addresses are:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: sit0: <NOARP,UP,LOWER_UP> mtu 1480 qdisc noqueue state UNKNOWN group default
link/sit brd
3: ip6tnl0@NONE: <NOARP,UP,LOWER_UP> mtu 1452 qdisc noqueue state UNKNOWN group default
link/tunnel6 :: brd ::
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:1e:06:30:3a:92 brd ff:ff:ff:ff:ff:ff
inet brd scope global dynamic eth0
valid_lft 86059sec preferred_lft 86059sec
inet6 fe80::21e:6ff:fe30:3a92/64 scope link
valid_lft forever preferred_lft forever
5: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether d2:df:a9:d0:7c:03 brd ff:ff:ff:ff:ff:ff
inet brd scope global eth1
valid_lft forever preferred_lft forever

Before I setup the router table I need to get the VPN on eth0 working.

If I remove the eth1 port as follows, then everything works fine:

$ sudo service isc-dhcp-server stop
$ sudo ifdown eth1

then the new routing table looks like this:

route -n
Destination Gateway Genmask Flags Metric Ref Use Iface U 50 0 0 ppp0 UG 100 0 0 eth0 UGH 0 0 0 eth0 UH 0 0 0 ppp0 UH 50 0 0 ppp0 U 100 0 0 eth0

And the ethernet is now successfully routed through my VPN.

Any suggestions on how to get the two ethernet connections working the required way would be appreciated.



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
Wrong default gateway set when attaching cable MartenH Linux - Networking 1 06-13-2013 03:25 PM
VMWare's bridging vs Window's bridging - routing is messed up when Windows bridging brenan99 General 0 05-04-2008 11:24 PM
bridging 3 nic xzibiz Slackware 3 12-01-2006 06:40 PM
Attaching new nic twantrd Solaris / OpenSolaris 2 08-14-2004 02:26 PM > Forums > Linux Forums > Linux - Networking

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

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