-1

Linux version : Ubuntu 22.04 server minimal

This box has 3 NIC cards and all those three NIC cards will be configured with static addresses by configuring in file /etc/netplan/00-installer-config.yaml as below.

network:
  ethernets:
    eno1:
      dhcp4: false
      addresses: [172.16.0.23/16]
      gateway4: 172.16.1.1
    eno2:
      dhcp4: true
    eno3:
      dhcp4: true
    enx00e04c682cb3:
      dhcp4: true
  version: 2

Ethernet enx00e04c682cb3 is a usb to ethernet dongle bought from amazon here.

Without configuring netplan, I am able to install packages.

Here is the output of ip route command:

ngapadmin@asrsimplex:/etc/netplan$ ip route
default via 10.228.233.1 dev enx00e04c682cb3 proto dhcp src 10.228.233.77 metric 100
10.228.226.36 via 10.228.233.1 dev enx00e04c682cb3 proto dhcp src 10.228.233.77 metric 100
10.228.226.37 via 10.228.233.1 dev enx00e04c682cb3 proto dhcp src 10.228.233.77 metric 100
10.228.233.0/25 dev enx00e04c682cb3 proto kernel scope link src 10.228.233.77 metric 100
10.228.233.1 dev enx00e04c682cb3 proto dhcp scope link src 10.228.233.77 metric 100
10.229.208.36 via 10.228.233.1 dev enx00e04c682cb3 proto dhcp src 10.228.233.77 metric 100

After I configure netplan, I am not able to install packages.

Output of ip route command:

ngapadmin@asrsimplex:/etc/netplan$ ip route
default via 172.16.1.1 dev eno1 proto static
default via 10.228.233.1 dev enx00e04c682cb3 proto dhcp src 10.228.233.77 metric 100
10.228.226.36 via 10.228.233.1 dev enx00e04c682cb3 proto dhcp src 10.228.233.77 metric 100
10.228.226.37 via 10.228.233.1 dev enx00e04c682cb3 proto dhcp src 10.228.233.77 metric 100
10.228.233.0/25 dev enx00e04c682cb3 proto kernel scope link src 10.228.233.77 metric 100
10.228.233.1 dev enx00e04c682cb3 proto dhcp scope link src 10.228.233.77 metric 100
10.229.208.36 via 10.228.233.1 dev enx00e04c682cb3 proto dhcp src 10.228.233.77 metric 100
172.16.0.0/16 dev eno1 proto kernel scope link src 172.16.0.23

Below is the error:

ngapadmin@asrsimplex:/etc/netplan$ sudo apt install chrony
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
  dnsutils
The following packages will be REMOVED:
  systemd-timesyncd
The following NEW packages will be installed:
  chrony
0 upgraded, 1 newly installed, 1 to remove and 147 not upgraded.
Need to get 290 kB of archives.
After this operation, 361 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 chrony amd64 4.2-2ubuntu2
  Cannot initiate the connection to ubuntu-mirror-1.ps6.canonical.com:80 (2620:2d:4002:1::101). - connect (101: Network is unreachable) Could not connect to ubuntu-mirror-1.ps6.canonical.com:80 (91.189.91.81). - connect (113: No route to host) Cannot initiate the connection to ubuntu-mirror-3.ps6.canonical.com:80 (2620:2d:4002:1::103). - connect (101: Network is unreachable) Could not connect to ubuntu-mirror-3.ps6.canonical.com:80 (91.189.91.83). - connect (113: No route to host) Cannot initiate the connection to ubuntu-mirror-1.ps5.canonical.com:80 (2620:2d:4000:1::101). - connect (101: Network is unreachable) Could not connect to ubuntu-mirror-1.ps5.canonical.com:80 (185.125.190.81). - connect (113: No route to host) Cannot initiate the connection to ubuntu-mirror-2.ps5.canonical.com:80 (2620:2d:4000:1::102). - connect (101: Network is unreachable) Could not connect to ubuntu-mirror-2.ps5.canonical.com:80 (185.125.190.82). - connect (113: No route to host) Cannot initiate the connection to ubuntu-mirror-3.ps5.canonical.com:80 (2620:2d:4000:1::103). - connect (101: Network is unreachable) Could not connect to ubuntu-mirror-3.ps5.canonical.com:80 (185.125.190.83). - connect (113: No route to host) Cannot initiate the connection to us.archive.ubuntu.com:80 (2620:2d:4002:1::103). - connect (101: Network is unreachable) Cannot initiate the connection to us.archive.ubuntu.com:80 (2620:2d:4002:1::101). - connect (101: Network is unreachable)
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/c/chrony/chrony_4.2-2ubuntu2_amd64.deb  Cannot initiate the connection to ubuntu-mirror-1.ps6.canonical.com:80 (2620:2d:4002:1::101). - connect (101: Network is unreachable) Could not connect to ubuntu-mirror-1.ps6.canonical.com:80 (91.189.91.81). - connect (113: No route to host) Cannot initiate the connection to ubuntu-mirror-3.ps6.canonical.com:80 (2620:2d:4002:1::103). - connect (101: Network is unreachable) Could not connect to ubuntu-mirror-3.ps6.canonical.com:80 (91.189.91.83). - connect (113: No route to host) Cannot initiate the connection to ubuntu-mirror-1.ps5.canonical.com:80 (2620:2d:4000:1::101). - connect (101: Network is unreachable) Could not connect to ubuntu-mirror-1.ps5.canonical.com:80 (185.125.190.81). - connect (113: No route to host) Cannot initiate the connection to ubuntu-mirror-2.ps5.canonical.com:80 (2620:2d:4000:1::102). - connect (101: Network is unreachable) Could not connect to ubuntu-mirror-2.ps5.canonical.com:80 (185.125.190.82). - connect (113: No route to host) Cannot initiate the connection to ubuntu-mirror-3.ps5.canonical.com:80 (2620:2d:4000:1::103). - connect (101: Network is unreachable) Could not connect to ubuntu-mirror-3.ps5.canonical.com:80 (185.125.190.83). - connect (113: No route to host) Cannot initiate the connection to us.archive.ubuntu.com:80 (2620:2d:4002:1::103). - connect (101: Network is unreachable) Cannot initiate the connection to us.archive.ubuntu.com:80 (2620:2d:4002:1::101). - connect (101: Network is unreachable)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

How do I setup the usb to ethernet dongle for package installations only and remaining all other network traffic from onboard NIC cards.

I understand I have to configure metrics to NICS using ifmetric command but need help if that's right approach and what should be the metrics.

2 Answers 2

1

You seem to have forgotten to set up the main internet protocol, IPv6, and routes for that. My suspicion is that one of your DHCP-configured interfaces delivers a global IPv6 route, and now your server tries to reach the (v6) internet through that interface, which doesn't actually connect to the internet.

3
  • Thankyou @marcus for your reply. Can u please guide on the setting I have to do. Commented Oct 30, 2024 at 0:44
  • I can't, because I don't know the rest of your setup and what youe DHCP servers tell your client. Commented Oct 30, 2024 at 9:28
  • I found a way with a link and added a default route to my eno1 interface with metric 100 and that's working. Exploring if that's the correct way to do. Commented Oct 30, 2024 at 15:18
0

I found a similar reference here and changed my netplan as below:

network:
  ethernets:
    eno1:
      dhcp4: false
      addresses: [172.16.0.23/16]
      routes: 
      - to: default
        via: 172.16.1.1
        metric: 100
    eno2:
      dhcp4: true
    eno3:
      dhcp4: true
    enx00e04c682cb3:
      dhcp4: true
  version: 2

and that gives me internet over interface enx00e04c682cb3 as well as internal connectivity over eno1

I am trying to learn what happened and why it started working.

Thanks for that.

1
  • This comment contains Very briefly: Several default routes will pick one interface at random, which leads to trouble because the assigned IP is different. . The 2nd ip route output in the question after configuring the netplan shows default routes on two different interfaces. I think the duplicates routes could be the cause of the issue. Posting as a comment since haven't verified this with a test. Commented Oct 30, 2024 at 15:30

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.