I'm trying to configure two Ethernet connections on the same computer running on Ubuntu but every attempts that I have made doesn't allow me to enable both Ethernet connections at the same time and I don't understand why. To have a better understanding of what I want to do, here is a description of the three involved computers represented at the following picture:
- Computer A: my personal computer (running on windows) which is connected to internet
- Computer B: a computer running on Ubuntu 22.04, connected via Ethernet to internet and to the computer C
- C : a Ubuntu server 22.04 which is only connected to the computer B via Ethernet
I want to have access to the computer C from the computer A with SSH.I already have set static ips on computers B and C:
- On computer B: xx.yy.zz.101 for the Ethernet port linked to the Ethernet port of the computer C
- On computer B: xx.yy.zz.100 for the Ethernet port connected to internet
- On computer C: xx.yy.zz.102 for the Ethernet port linked to the Ethernet port of the computer B
So, I should be able to access first from computer A to computer B with the command:
ssh xx.yy.zz.100
and then from computer B to C with the command:
ssh xx.yy.zz.102
Nevertheless, I can do only one of the two connections (depending on which one is active). The netplan configuration file of the computer B is:
---network: version: 2 ethernets: enp35s0: # Connection to computer C dhcp4: false addresses: [xx.yy.zz.101/24] # Need to configure a static ip gateway4: xx.yy.zz.1 enp42s0: # Connection to internet dhcp4: false addresses: [xx.yy.zz.100/24] # Need to configure a static ip gateway4: xx.yy.zz.1 nameservers: - addresses: [a.b.c.d, e.f.g.h]
and the command "ip a" shows:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever2: enp35s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 00:13:3b:0f:8f:36 brd ff:ff:ff:ff:ff:ff inet 10.102.100.101/24 brd 10.102.100.255 scope global enp35s0 valid_lft forever preferred_lft forever inet6 fe80::213:3bff:fe0f:8f36/64 scope link valid_lft forever preferred_lft forever3: enp36s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 00:13:3b:0f:8f:37 brd ff:ff:ff:ff:ff:ff4: enp42s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 2c:f0:5d:9a:e0:2c brd ff:ff:ff:ff:ff:ff inet 10.102.100.100/24 brd 10.102.100.255 scope global enp42s0 valid_lft forever preferred_lft forever inet6 fe80::2ef0:5dff:fe9a:e02c/64 scope link valid_lft forever preferred_lft forever
Can you help me to understand why the two Ethernet interfaces can't be used at the same time? I already tried several options, like using the routes option with some priority but I have never succeeded to do what I want so I don't know which is simple way to do what I want.