openwrt / luci

LuCI - OpenWrt Configuration Interface
Apache License 2.0
6.38k stars 2.53k forks source link

luci-mod-network: confusing MTU settings on PPPoE connection. #6803

Open timur-davletshin opened 10 months ago

timur-davletshin commented 10 months ago
DISTRIB_TARGET='x86/geode'
DISTRIB_ARCH='x86'
DISTRIB_DESCRIPTION=openwrt-23.05 branch (git-23.357.58018-024e7ab)/OpenWrt 23.05.2 (r23630-842932a63d)

Generally there two ways to set up MTU. One is in the Devices tab (Luci UI) and the other one is in the Interfaces tab (I'm talking about PPPoE connection).

They correspond to respective parts of the configuration file: /etc/config/network:

config interface 'wan'
    option proto 'pppoe'
    option device 'eth0'
...
    option mtu '1492'

config device
    option name 'pppoe-wan'
    option mtu '1492'

Actual behavior:

Only MTU in device section (or Devices tab) will actually apply to PPPoE connection. The other one in interface does nothing. Check can be done by ifconfig or directly via Luci UI.

Expected behavior:

Remove duplicating (and non-functioning) MTU settings in PPPoE interface settings (Interfaces tab).

Note: I'm not talking about physical interface (eth0 in this example), only about pppoe-wan.

jow- commented 10 months ago

Interface mtu option should translate to pppd mtu/mru cli arguments.

systemcrash commented 10 months ago

The word 'should' is doing a lot of lifting here.

systemcrash commented 10 months ago

Shouldn't proto_pppoe_setup()call to ppp_generic_setup() pass mtu also?

https://github.com/openwrt/openwrt/blob/f1de1a090fadc74504b3ee1b5bcb914c9110bc6f/package/network/services/ppp/files/ppp.sh#L219-L242

systemcrash commented 7 months ago

@jow-: for pppoe "should" is false. The MTU option needs to apply to the 'ethernet' interface responsible for the connection, if there is one.

The manpages for the pppoe.so module list zero (direct) options for MTU. https://www.man7.org/linux/man-pages/man8/pppd.8.html#PPPOE_OPTIONS

So two solutions here seem evident: either a) delete the GUI option, or b) remap it so that it applies to the underlying interface (less trivial).

Closed by 995d3a1801cf3b850e8c7c35937fbdd0526ff53e

systemcrash commented 7 months ago

See also https://github.com/openwrt/openwrt/pull/15176

timur-davletshin commented 6 months ago

I see luci-proto-ppp has returned MTU settings back. Can someone clarify what does this MTU settings do?

hnyman commented 6 months ago

Can someone clarify what does this MTU settings do?

See

systemcrash commented 6 months ago

I see luci-proto-ppp has returned MTU settings back. Can someone clarify what does this MTU settings do?

Apparently not what one thinks it should do.

jow- commented 6 months ago

It is supposed to control the PPP MRU/MTU values which are independent from the underlying ethernet MTU. Due to a bug in netifd this option currently is inoperable, a fix is being worked on.

timur-davletshin commented 6 months ago

@jow- so the pppd's part working fine it's just 'Devices' tab which is broken?

jow- commented 6 months ago

No, netifd / the ppp protocol handler is broken, the fix for this will not happen in LuCI.