cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
11.23k stars 1.11k forks source link

Support pppoe settings in the network page. #17168

Open PupilTong opened 2 years ago

PupilTong commented 2 years ago

Page: Network

Hi, I'm trying to use ubuntu as my family router. I found that cockpit doesn't have a pppoe settings in the network page. I'm wondering if it's possible to add this feature?

As well as firewall settings(iptables, ufw...) and even dnsmasq settings( for dns server and dhcp server)

Thanks!

gil-obradors commented 2 years ago

Hi! I'm working on, so I share the work done so far For write a minium base I have tested a PoC with Python, pppoe object represents the connection argument for dbus, so We need a Wizard to generate and send it:

import uuid
from pydbus import SystemBus, Variant

bus = SystemBus()
remote_object = bus.get("org.freedesktop.NetworkManager",
                        "/org/freedesktop/NetworkManager/Settings")
pppoe = {"connection": {'id': Variant('s', "PPPoE Client"),
                        'interface-name': Variant('s', "pppo34"),
                        'type': Variant('s', 'pppoe'),
                        'uuid': Variant('s', str(uuid.uuid4()))},
         'ppp': {'lcp-echo-failure': Variant('u', 5),
                 'lcp-echo-interval': Variant('u', 30)},
         'pppoe': {'password': Variant('s', 'gilitopassword'),
                   'username': Variant('s', 'gilito-user'),
                   'parent': Variant('s', 'eno2')
                   },
         'ipv4': {'method': Variant('s', 'auto')}
         }

remote_object.AddConnection(pppoe)

Other advanced options nm-connection-edit are: imatge

imatge imatge imatge imatge

Next steeps:

marusak commented 1 year ago

@gil-obradors any updates on this?

gil-obradors commented 1 year ago

Hi! I'm not currently working on I was centered on Wireguard but I found an architectural problem that greatly complicates the process and I stopped. Include PPPoE if easy to achieve.