Build with IPv6 removed, but pppd cmdline still shows some ipv6 related stuff?

BACKGROUND - HOW I DISABLE IPv6

CLICK HERE TO SHOW

I compile my own OpenWRT 18.06 (current trunk is a bit unstable) for my TP-W8970 v1.
With make menuconfig I remove/unset:

  • Global build settings > Enable IPv6 support in packages
  • Base system > busybox > Networking Utilities > Enable IPv6 support
    (to be shown this need Customize busybox options to be set)
  • Kernel modules > Netfilter Extensions > kmod-nf-ipt6
  • Libraries > Firewall > libip6tc
  • Network > odhcpd-ipv6only
  • Network > odhcpd (should be unset by default if I remember correctly)

That should be everything right? There are always some "leftovers" so I remove them after a flash:

  • Remove some IPv6 addresses inside /etc/hosts (that are no more recognized ofc)
  • Remove option ula_prefix from /etc/config/network (and all the other IPv6 related settings I can find)
  • Remove the wan6 interface (with LUCI)
  • Remove IPv6 related rules fom firewall (with LUCI)
  • Remove IPv6 addresses from /etc/config/uhttpd
  • Remove IPv6 forwarding settings from /etc/sysctl.d/10-default.conf

After this (just to be sure/paranoid) I:

  • Add option ipv6 '0' after each option proto inside /etc/config/network
  • Add option disable_ipv6 '1' to /etc/config/firewall defaults

THE PROBLEM

CLICK HERE TO SHOW

Today I run ps on the router and saw some funny stuff about the running pppd process, so I run

cat /proc/<pppd pid>/cmdline | tr "\0" " "

And get

/usr/sbin/pppd nodetach ipparam wan ifname pppoa-wan set PEERDNS=0 nodefaultroute usepeerdns maxfail 1 user ******** password ******** ip-up-script /lib/netifd/ppp-up ipv6-up-script /lib/netifd/ppp6-up ip-down-script /lib/netifd/ppp-down ipv6-down-script /lib/netifd/ppp-down mtu 1478 mru 1478 plugin pppoatm.so 0.8.35 vc-encaps

As you can see, the cmdline include:

  • ipv6-up-script /lib/netifd/ppp6-up (different script/file than ip-up-script)
  • ipv6-down-script /lib/netifd/ppp-down (same script/file as ip-down-script)

I checked and /lib/netifd/ppp6-up exist. How is the pppd started? If it's from a script, can I edit it and simply remove ipv6-up-script /lib/netifd/ppp6-up and ipv6-down-script /lib/netifd/ppp-down from the cmdline?


ANOTHER MINOR PROBLEM (unrelated to IPv6 but related to pppd)

CLICK HERE TO SHOW

With LUCI I edited the wan interface and chose to ignore advertised DNS by ISP, and replaced them with 1.1.1.1 and 1.0.0.1.

Looking again at the pppd cmdline I can see both PEERDNS=0 and usepeerdns as parameters. From the LUCI overview page the ISP DNS are properly ignored and replaced. usepeerdns seems useless, and (from it's name) it exactly seems what I do not want, should I remove it? And how?


UPDATE/EDIT
Added noipv6 to /etc/ppp/options, reboot, but nothing changed.

Figured it out. I changed /lib/netifd/proto/ppp.sh:

  • removed usepeerdns
  • removed any reference to ipv6 stuff
  • added noipv6 also there

If anyone is interested: full diff here.

1 Like

I'm pretty sure the IPv6 stuff you removed is only setting some variables it won't use anyway if IPv6 is disabled.

@jow: Is it correct that usepeerdns should be hardcoded when there is also a peerdns setting? In this old commit the configurable setting was removed when usepeerdns was added, but then the configurable setting seems to have been readded without the hardcoded setting being removed. Perhaps they are settings for different things? https://github.com/openwrt/openwrt/commit/d2212229078838fb244f65b6685d702a9f646d0d

1 Like

Yes it is correct, we always request peerdns and decide in the ppp-up / netifd scripts whether to use it or not. Specifically, all info is passed on to netifd which then decides based on the uci configuration whether to use it or not.

Ty guys for the infos. I will still keep this changes just bacause my mind is happier... Btw, where, and to who, should I ask more question about how pppd works?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.