1

Breif

I'm trying to configure a computer-to-computer (via a switch although this isn't directly relevant) network to be used as a high-speed link between my workstation and a server. Both are Debian 10 systems.

Network Topology

Here is a diagram of my network topology. (Created with http://asciiflow.com/ - might not be secure)

          +----------------+
          |                |
          |   ISP Router   |
          |  192.168.0.254 |
          |                |
          +-+------------+-+
            |            |
            |            |
     enp7s0 |            | enp7s0
192.168.0.1 |            | 192.168.0.2
            |            |
+-----------+-+        +-+------+
| WORKSTATION |        | SERVER |
+-----------+-+        +-+------+
            |            |
   enx...   |            | enx...
   10.0.0.1 +------------+ 10.0.0.2

/etc/network/interfaces file

Here is my /etc/network/interfaces file (same on both systems except the static address)

source /etc/network/interfaces.d/* # this is empty

# The loopback network interface
auto lo
iface lo inet loopback

iface enp7s0 inet static
    address 10.0.0.1/8
#   broadcast 10.255.255.255
#   netmask 255.0.0.0

Status at boot

When I boot either system and check the interfaces using ip addr, this is the result

2: enp7s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 6c:f0:49:ee:47:a6 brd ff:ff:ff:ff:ff:ff
3: enx...: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether ... brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.1/24 brd 192.168.0.255 scope global dynamic noprefixroute ...
       valid_lft 85332sec preferred_lft 85332sec
    inet6 ...

So it looks like enp7s0 is not raising at boot. If I run sudo ifup enp7s0 it comes up with the expected static address, and both computers can communicated via ssh on this link.

What should I do to get this interface to raise on boot?

1
  • It seems to me that your question is actually "How to autmatically bring up an interface on boot on debian based systems". Do you agree?
    – Zip
    May 20, 2020 at 0:28

1 Answer 1

1

Add auto enp7s0 to your interfaces file, just like auto lo is already there, like this:

source /etc/network/interfaces.d/* # this is empty

# The loopback network interface
auto lo
iface lo inet loopback

auto enp7s0
iface enp7s0 inet static
    address 10.0.0.1/8
#   broadcast 10.255.255.255
#   netmask 255.0.0.0

From man interfaces:

Lines beginning with the word "auto" are used to identify the physical interfaces to be brought up when ifup is run with the -a option. (This option is also used by the system boot scripts, so interfaces marked "auto" are brought up at boot time.) Physical interface names should follow the word "auto" on the same line. There can be multiple "auto" stanzas. ifup brings the named interfaces up in the order listed.

4
  • Such a simple solution - I should have realized this May 20, 2020 at 0:46
  • Ok another question then - there is no entry for enx...blaa blaa. How does this USB device get automatically raised? May 20, 2020 at 0:48
  • 1
    You can just make an entry for it. The enx... prefix indicates that the rest of the interface name is simply the MAC address of the network interface. For USB interfaces, you may want to use allow-hotplug enx... instead of/in addition to auto enx...: the auto keyword tells the system to make one attempt to start the interface at start-up time, while allow-hotplug will start the interface any time it is plugged in. It works with non-USB interfaces too.
    – telcoM
    May 20, 2020 at 6:50
  • 1
    You probably have NetworkManager running, and it will probably try at least DHCP to configure the interface if it detects an interface with no configuration and a valid link.
    – telcoM
    May 20, 2020 at 6:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .