0

I have a new machine which I'm setting up as my LAN router using the 18.04 server release, to provide DHCP and bind services to my LAN, firewalling, NAT'ing, internet access etc.

It has 2 ethernet NICs and one of them is connected to my Draytek ADSL modem which requires ppp.

I've installed everything that I think I need but my configuration is obviously wrong since ppp can't build an internet connection.

Going by this answer How do I use netplan to configure PPPoE? it should be relatively easy, but the answer omits the crucial info that I'm after, i.e. what to put in the netplan yaml - or whatever else it is that I'm missing.

I may have caused the problem myself by installing xubuntu-core to provide a minimal desktop / window manager GUI for ease of surfing the net while working on it. I fear it introduced network-manager although I'm not sure.

This is my netplan yaml:

adam@gondolin:~$ cat /etc/netplan/01-netcfg.yaml 
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    enp5s0:
      dhcp4: yes
    enp0s31f6:
      dhcp4: no
      dhcp6: no
adam@gondolin:~$ 

I have the enp5s0interface set to use DHCP so that I can get onto the LAN and access the internet while I'm prepping this server, although when it is ready, that interface will be the router's interface for the LAN with a fixed IP address 192.168.0.3.

This is the ifconfig -a output:

adam@gondolin:~$ ifconfig -a
enp0s31f6: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether e0:d5:5e:62:97:4c  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xf7400000-f7420000  

enp5s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.228  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::e2d5:5eff:fe62:974e  prefixlen 64  scopeid 0x20<link>
        ether e0:d5:5e:62:97:4e  txqueuelen 1000  (Ethernet)
        RX packets 5561  bytes 431753 (431.7 KB)
        RX errors 0  dropped 898  overruns 0  frame 0
        TX packets 4462  bytes 1871915 (1.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xf7200000-f721ffff  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 9479  bytes 757999 (757.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 9479  bytes 757999 (757.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp6s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.230  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::39c6:9a99:7b58:1cf1  prefixlen 64  scopeid 0x20<link>
        ether 00:e1:8c:75:39:d3  txqueuelen 1000  (Ethernet)
        RX packets 29  bytes 4677 (4.6 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 64  bytes 9172 (9.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

adam@gondolin:~$ 

which displays the info about the wifi interface too - another suspicious sign but I am not using it - is disabling it in netplan a good idea? (and how?)

And this is the output of networkctl:

adam@gondolin:~$ networkctl
IDX LINK             TYPE               OPERATIONAL SETUP     
  1 lo               loopback           carrier     unmanaged 
  2 enp5s0           ether              routable    configured
  3 enp0s31f6        ether              off         unmanaged 
  4 wlp6s0           wlan               routable    unmanaged 

4 links listed.
adam@gondolin:~$ 

Here's the syslog error from trying to start ppp:

Aug 26 22:03:10 localhost pppd[10297]: Plugin rp-pppoe.so loaded.
Aug 26 22:03:10 localhost pppd[10298]: pppd 2.4.7 started by adam, uid 0
Aug 26 22:03:10 localhost pppd[10298]: error sending pppoe packet: Network is down
Aug 26 22:03:10 localhost pppd[10298]: error receiving pppoe packet: Network is down
Aug 26 22:03:15 localhost pppd[10298]: error sending pppoe packet: Network is down
Aug 26 22:03:25 localhost pppd[10298]: error sending pppoe packet: Network is down
Aug 26 22:03:45 localhost pppd[10298]: Timeout waiting for PADO packets
Aug 26 22:03:45 localhost pppd[10298]: Unable to complete PPPoE Discovery
Aug 26 22:03:51 localhost pppd[10298]: Terminating on signal 15
Aug 26 22:03:51 localhost pppd[10298]: Exit.

Finally, here's my /etc/ppp/peers/provider:

adam@gondolin:~$ cat /etc/ppp/peers/provider
# See the manual page pppd(8) for information on all the options.
# There should be a matching entry with the password in /etc/ppp/pap-secrets
# and/or /etc/ppp/chap-secrets.
user "adam.xxxxx@xxxxxxx-xxxx.com"
hide-password
plugin rp-pppoe.so nic-enp0s31f6
# MUST CHANGE: replace ******** with the phone number of your provider.
# The /etc/chatscripts/pap chat script may be modified to change the
# modem initialization string.
#connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T ********"
# Serial device to which the modem is connected.
#/dev/modem
# Speed of the serial line.
#115200
# Assumes that your IP address is allocated dynamically by the ISP.
noipdefault
# Don't try to get the name server addresses from the ISP - messes up local name resolution
#usepeerdns    
# Use this connection as the default route.
defaultroute
replacedefaultroute
# Makes pppd "dial again" when the connection is lost.
persist
# Do not ask the remote to authenticate.
noauth

adam@gondolin:~$ 

I also see a stream of logging in syslog on boot showing that something is resurrecting network-manager despite the fact that I disabled it with sudo systemctl disable network-manager

Adam
  • 1,149

1 Answers1

0

I managed to fix ppp.

I made several changes. I stopped, disabled and removed network-manager and its package. This stopped Ubuntu firing it up on boot, which was presumably a reaction to finding the wifi network interface in the system.

Actually I tried configuring /etc/NetworkManager/NetworkManager.conf to ignore all interface-names with wl like this:

[keyfile]
unmanaged-devices=interface-name:wl*

but that didn't help.

I wasted a lot of time on the wifi interface because I thought it would be handy to set it up so that I could have the 2 ethernet cards free to configure as they would be, without having to worry about how I ssh'd onto the machine. That decision cost me a couple of hours.

This is my current netplan yaml:

adam@gondolin:~$ cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    enp5s0:
      dhcp4: no
      dhcp4: no
      addresses: [ 192.168.0.3/24 ]
    enp0s31f6:
      addresses:
      - fe80::10/128
      dhcp4: no
      dhcp6: no
  wifis:
    wlp6s0:
      dhcp4: yes
      dhcp6: yes
      access-points:
        "ANDUIN":
          password: "top-secret"
adam@gondolin:~$ 

One of the key things was the IPv6 address for the external facing NIC enp0s31fs - this is a work-around to a netplan issue https://bugs.launchpad.net/netplan/+bug/1763608 which causes netplan to leave interfaces down if they have no IP address. I assume this will cause IPv6 issues in another lifetime.

I haven't installed ppp as a service or onto a networkd-dispatcher hook,nor have I managed to get the connection to the internet ready yet, so I'm not done yet, but at least this question is answered.

Adam
  • 1,149