I have a few interfaces: wlan0, eth0, lo, and sometimes tun0. When I connect to the Juniper VPN, creating a tun0 interface, my existing connections on other interfaces (perhaps with the exception of lo) are interrupted, and they reconnect using the tun0 interface.

I only want to use tun0 on particular connections of my choosing, not all of them, and not by default. How can I ensure that the default interface is eth0 or wlan0? The output of ip addr is here:

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: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether d4:be:d9:65:c1:45 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 24:77:03:ab:a6:dc brd ff:ff:ff:ff:ff:ff
    inet brd scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 2601:d:a780:2c3:f803:d084:a01f:f156/64 scope global temporary dynamic 
       valid_lft 86397sec preferred_lft 14397sec
    inet6 2601:d:a780:2c3:2677:3ff:feab:a6dc/64 scope global dynamic 
       valid_lft 86397sec preferred_lft 14397sec
    inet6 fe80::2677:3ff:feab:a6dc/64 scope link 
       valid_lft forever preferred_lft forever
5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1400 qdisc pfifo_fast state UNKNOWN group default qlen 500
    inet scope global tun0
       valid_lft forever preferred_lft forever

Source: http://sprunge.us/KKGP

I noticed that tun0 is on the bottom, so I would think it's bottom priority, too?

NOTE: For what it's worth, I don't know how to modify the priority of the other interfaces either (eth0, wlan0, lo).


1 Answer 1


It not about interface priority. The routing table determines what path your traffic will take. See ip route show and ip route get ipaddress

Most VPNs push a default route via themselves. In my OpenVPN setup I've configured it to only push routes to the internal IP space, however that is a server-side option.

Your client may offer the option of ignoring the pushed routes and specifying your own.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.