Setting default network interface?

12,552

You just need to set the default gateway to the correct interface.

It should be configured in your GUI (Network Manager for example) or if you feel a bit geeky, you can configure it in your /etc/network/interfaces

This is a minimal configuration example for your /etc/network/interfaces file:

auto eth0
iface eth0 inet static
  address 192.168.0.100
  netmask 255.255.255.0
  gateway 192.168.0.1
  dns-nameserver 192.168.0.1 8.8.8.8

You need to replace the values with your personal network settings. Make sure not to set two gateways at the same time. This will cause problems and is only possible if you use different routing tables.

Edit: Don't use DHCP on eth6 should work as well. Configure just an IP address in your Network Manager and leave eth0 as it is.

Share:
12,552

Related videos on Youtube

user5104897
Author by

user5104897

Updated on September 18, 2022

Comments

  • user5104897
    user5104897 over 1 year

    I have a Debian workstation with two interfaces: the ethernet jack attached to the motherboard (eth0), and a USB to ethernet adapter (eth6). eth0 connects to the internet, while eth6 connects to some special equipment only accessible over ethernet.

    When the workstation starts, it connects to eth6 by default; when this happens the workstation cannot reach the internet and I must choose to connect to eth0 from the network manager. I would like it to connect to eth0 by default. How can I do this?