Results 1 to 4 of 4

Thread: How do I make eth0 the default network interface?

  1. #1
    Join Date
    May 2006
    Location
    Oslo, Norway
    Beans
    243
    Distro
    Ubuntu 13.10 Saucy Salamander

    Unhappy How do I make eth0 the default network interface?

    I have set up VPN on a server. Whenever I start the VPN server with
    Code:
    sudo service openvpn start
    all internet traffic is routed through the tun0 interface, which then becomes available. However, I still want the server to use eth0 when I start openvpn. How do I make it the default interface?

    I want the tun0 to be available, since I'm using this interface for one user only.
    Last edited by miceagol; December 14th, 2013 at 09:36 PM. Reason: typo

  2. #2
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,116

    Re: How do I make eth0 the default network interface?

    I'm not familiar with VPN in Ubuntu yet, but can't you define static routes so that all but the traffic from that particular user goes through eth0?

    Please see this (mostly unrelated post) if you know even lesser than I do about routing table : http://ubuntuforums.org/showthread.php?p=12819114

    Accordingly, I'd like to see the output of "route -n" after tun0 interface is created, also the IP of the user for which you want to use it.
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags

  3. #3
    Join Date
    May 2006
    Location
    Oslo, Norway
    Beans
    243
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How do I make eth0 the default network interface?

    Quote Originally Posted by varunendra View Post
    I'm not familiar with VPN in Ubuntu yet, but can't you define static routes so that all but the traffic from that particular user goes through eth0?

    Please see this (mostly unrelated post) if you know even lesser than I do about routing table : http://ubuntuforums.org/showthread.php?p=12819114

    Accordingly, I'd like to see the output of "route -n" after tun0 interface is created, also the IP of the user for which you want to use it.
    The thing is that I have already created a script which runs all traffic from one specific user through the tun0 interface. This script worked flawlessly to start with, then suddenly all traffic started to use the tun0 interface whenever openvpn is running.

    So there has to be something wrong with the default routing.

    route -n before starting openvpn:
    Code:
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         192.168.19.1    0.0.0.0         UG    0      0        0 eth0
    192.168.19.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
    192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
    After starting openvpn:
    Code:
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         10.104.1.5      128.0.0.0       UG    0      0        0 tun0
    0.0.0.0         192.168.19.1    0.0.0.0         UG    0      0        0 eth0
    10.104.1.1      10.104.1.5      255.255.255.255 UGH   0      0        0 tun0
    10.104.1.5      0.0.0.0         255.255.255.255 UH    0      0        0 tun0
    109.201.154.154 192.168.19.1    255.255.255.255 UGH   0      0        0 eth0
    128.0.0.0       10.104.1.5      128.0.0.0       UG    0      0        0 tun0
    192.168.19.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0
    192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
    Last edited by miceagol; December 18th, 2013 at 08:55 PM. Reason: typo

  4. #4
    Join Date
    May 2006
    Location
    Oslo, Norway
    Beans
    243
    Distro
    Ubuntu 13.10 Saucy Salamander

    Re: How do I make eth0 the default network interface?

    And with the above routing after starting openvpn, I lose my Internet connection, so there is something wrong with that table. But I need help to find the error. :-/

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •