When configuring a PPPoE interface, allow the underlying interface to access the modem
When you configure an interface as PPPoE, you configure it on a normal interface, but the normal interface then disappears from the webconfig. In order to access the modem interface I need to give the underlying virtual interface an IP address on the modem's LAN. In my case the modem has a DHCP server and I am not sure how to achieve getting an IP by DHCP. With enp2s0 as the underlying WAN interface, I can give it an IP address manually with the command:
ifconfig enp2s0:0 192.168.2.2 netmask 255.255.255.0
At the same time a firewall rule is needed:
iptables -t nat -I POSTROUTING -o enp2s0 -d 192.168.2.0/24 -j MASQUERADE
This cannot currently be achieved through the webconfig as the dropdown with the interfaces in it does not display the underlying intergace. Perhaps in the PPPoE config there should be a box to allow the assignment of a static IP.
The Webconfig should also take the interface down when ppp0 is deleted:
ifconfig enp2s0:0 down
This is to avoid a potential IP conflict if the underlying interface is DHCP and receives the same address by DHCP on the interface.
Note the virtual IP should exist all the time the pppX interface is defined and not just when it is up, or you cannot access the modem when ppp0 goes down.