1

I have read a lot about NetPlan - it sounds awesome compared to the old interfaces file...

But everything I've tried generates a default route to the lan interface - (which disables access to the Internet)

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.1.1     0.0.0.0         UG    0      0        0 lan
default         71.x.x.x        0.0.0.0         UG    100    0        0 wan
71.x.x.x        0.0.0.0         255.255.252.0   U     0      0        0 wan
71.x.x.1        0.0.0.0         255.255.255.255 UH    100    0        0 wan
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 lan

Here's an example:

10-router.yaml

network:
    version: 2
    renderer: networkd
    ethernets:
        wan:
            optional: true
            dhcp4: true
            dhcp6: true
        lan:
            addresses: [192.168.1.1/24]
            optional: true
            dhcp4: false
            dhcp6: false
            nameservers:
                search: [thebox.qqq]
                addresses: [84.200.69.80, 84.200.70.40, 9.9.9.9]

The one possible solution I've found on the internet is to add a gateway to the 'wan' interface, but it demands an IP that I can't specify (ISP DHCP).

Things I've tried:

  • every combination of 'optional'
  • every combination of 'dhcp4'
  • putting 'lan' first in the file
  • variations on lan addresses
  • variations on nameservers
  • using network-manager (default netplan)
  • purging network-manager
  • routes... but I don't have an IP for 'via'
  • manually deleting the bad route sudo route del default lan ... it comes back!
$ sudo lshw -C network
  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: lan
       version: 06
       serial: 90:2b:34:ad:32:52
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full firmware=rtl8168e-3_0.0.4 03/27/12 ip=192.168.1.1 latency=0 link=yes multicast=yes port=MII speed=1Gbit/s
       resources: irq:17 ioport:ee00(size=256) memory:fdcff000-fdcfffff memory:fdcf8000-fdcfbfff
  *-network
       description: Ethernet interface
       product: RTL8169 PCI Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 7
       bus info: pci@0000:05:07.0
       logical name: wan
       version: 10
       serial: 00:e0:53:16:0a:93
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 66MHz
       capabilities: pm bus_master cap_list rom ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 duplex=full ip=71.59.50.52 latency=64 link=yes maxlatency=64 mingnt=32 multicast=yes port=MII speed=1Gbit/s
       resources: irq:21 ioport:ac00(size=256) memory:fdaff000-fdaff0ff memory:fd900000-fd91ffff
2
  • Where are the "wan:" and "lan:" interface names coming from? 192.168.1.1 is probably your router's address, so you can't use it. Edit your question and show me sudo lshw -C network. Start comments to me with @heynnema or I'll miss them. – heynnema Mar 14 at 20:23
  • It seems I've failed to explain - Ubuntu is the router. The cable modem is not a router -just an ethernet connection through which the ISP which is willing to provide DHCP to a known mac address - which is held by 'wan'. – Jeff K Mar 14 at 21:18
0

Nothing shown in your netplan config would cause a default route to be set on the lan interface. Look for some other process that is running on your system that may be doing this, such as an extra dhcp client.

2
  • I know that 'sudo netplan apply' will immediately regenerate the lan route - is there a way to find the source in a log or something? – Jeff K Mar 16 at 2:42
  • The system is a fairly minimal Kubuntu 20.04 install. This is the first thing I wanted to work, cuz internets are important. In the process of debugging this - I apt-get purged network-manager (good riddance). I can't imagine anything else that would mess with my network? – Jeff K Mar 16 at 2:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.