How do i set a prefered network interface

Asked by Pétur Ingi Egilsson

Hello

I have a laptop.

Sometimes i need to connect a wire to eth0 cos i need to transfer large data sets.

My wireless wlan0 is always connected, meaning its sometimes connected at same time as the eth0 wiredconnection.

wlan0 and eth0, if connected at the same time are always on the same ip-network

I need a way to nail eth0 down as the primary interface (if in use), and else use wlan0.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu yelp Edit question
Assignee:
No assignee Edit question
Solved by:
anonymous1
Solved:
Last query:
Last reply:
Revision history for this message
Best anonymous1 (anonymous1-deactivatedaccount) said :
#1

Open "/etc/network/interfaces" in your preferred editor.

# The primary network interface
auto eth0
iface eth0 inet static
        address 10.0.0.2
        netmask 255.255.255.252
        gateway 10.0.0.1
        broadcast 10.0.0.3

eth0 is defined as the primary network interface in the above example, check yours.

Revision history for this message
Pétur Ingi Egilsson (petur) said :
#2

petur@O2:~$ cat /etc/network/interfaces
auto lo
iface lo inet loopback

The network is configured using NetworkManager

Revision history for this message
anonymous1 (anonymous1-deactivatedaccount) said :
#3

Customizing the example that I wrote above will automatically make eth0 the primary network interface.

Revision history for this message
Pétur Ingi Egilsson (petur) said :
#4

Thanks Steffan Wood, that solved my question.