How to disable ipv6 from OpenWrt?

I have the WAN6 interface "bring up on boot" button UNCHECKED. Under LAN and WAN, I have the ipv6 settings set to "disable." Yet my devices continue to get ipv6 addresses assigned to them. Is there another setting I need to tweak to disable ipv6 on OpenWRT?

If memory serves me, this was all I needed to do under 17.01.5. I am now running 18.06.1. Thanks!

If you've got a kernel that is IPv6 capable, then you'll get link-local IPv6 addresses on loopback, as well as the other interfaces. ip -6 addr is one way show them.

inet6 ::1/128 scope host 
inet6 fe80::a4a1:43ff:mmmm:nnnn/64 scope link

These addresses don't route off the current link and are required by IPv6 specs.

Are the addresses you seeing other than link-local ones?

Entirely disabling IPv6 can cause problems with some software packages that now bind to ::1 (loopback), for example.

1 Like
% ip -6 addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::468a:5bff:fe9e:e7a3/64 scope link 
       valid_lft forever preferred_lft forever
3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::e010:11ff:febe:7db6/64 scope link 
       valid_lft forever preferred_lft forever

I ask because upon updating to 18.06.1, I can no longer use distcc on my LAN... I get tons of errors like the ones shown below. Never experienced this under 17.01.6 with IPv6 disabled as I described.

distcc[21676] ERROR: nonblocking connect to fe80::468a:5bff:fe9e:e7a3%eno1:3632 failed: Connection refused
distcc[21676] ERROR: nonblocking connect to fe80::e010:11ff:febe:7db6%br0:3632 failed: Connection refused
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/empty.o
  HOSTCC  scripts/dtc/dtc.o
  CC      scripts/mod/devicetable-offsets.s
distcc[21697] ERROR: nonblocking connect to fe80::468a:5bff:fe9e:e7a3%eno1:3632 failed: Connection refused
distcc[21697] ERROR: nonblocking connect to fe80::e010:11ff:febe:7db6%br0:3632 failed: Connection refused
  HOSTCC  scripts/dtc/flattree.o
distcc[21706] ERROR: nonblocking connect to fe80::468a:5bff:fe9e:e7a3%eno1:3632 failed: Connection refused
distcc[21706] ERROR: nonblocking connect to fe80::e010:11ff:febe:7db6%br0:3632 failed: Connection refused
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/treesource.o
distcc[21717] ERROR: nonblocking connect to fe80::468a:5bff:fe9e:e7a3%eno1:3632 failed: Connection refused
distcc[21717] ERROR: nonblocking connect to fe80::e010:11ff:febe:7db6%br0:3632 failed: Connection refused

I restored the ipv6 settings to the defaults (enabled) with the exception of the interface WAN6. My question is why after updating to 18.06.1 am I experiencing these errors? If I downgrade back to 17.01.5, distcc behaves normally, not throwing these errors.

I'm not sure which machine you're "running" distcc on, but it looks like it's trying to connect to the link-local addresses. Is there something on your network (like mDNS) that might be advertising those addresses as valid for the hostnames you've specified for distcc?

I'm not running anything like mDNS at all. I defined the DISTCC_HOSTS in my shellrc file but they are defined as hostnames.

Seems to correspond with when the poster on the Gentoo forum (with perhaps the reverse problem) had name resolution.

I found that link as well... it's odd that 18.06.1 causes it whereas 17.01.5 is fine :confused:

An update: if I entirely disable ipv6 on both of the linux boxes running distcc via the following file, everything works as expected. It seems as though something in OpenWRT 18.06.1 (or at least how I have it configured) is causing these ipv6 addresses to get assigned via DHCP and causing these distcc fits. Any advice is appreciated.

% cat /etc/sysctl.d/99-stuff.conf 
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

As I don't run DHCP, DNS, or IPv6 advertisements on my OpenWrt systems, I'm not terribly familiar as to how the OpenWrt configuration of those features works.

For someone else that may have greater insight, it looks as though the log you posted, above in this thread, is from the OpenWrt host (based on the link names) reporting that other hosts on your network are trying to connect to distcc running on the OpenWrt host. Is that correct?

I think it's more the case that the logs are on his Linux machines, and they are looking up hostnames and getting ipv6 link local addresses. Can you go to the distcc hosts and run host lookups for the hostnames you use please? I suspect you'll get the link local addresses possibly by mdns running on the hosts themselves rather than the router

@vgaetera - Is there an equilivant setting from Luci?
@dlakelan - Running host xxx returns both an ipv4 and ipv6 address. When I reworked my linux network configuration (systemd-networkd) like what I'm showing below, the ipv6 address is no longer returned from the host command BUT it is still assigned to the client NIC for some reason. I should add that after this modification, distcc works again!

/etc/systemd/network/dhcp.network
[Match]
Name=enp4s0

[Network]
DHCP=ipv4
LinkLocalAddressing=no
IPv6AcceptRA=no

What's going on is that distcc is looking up a hostname and getting an ipv4 and ipv6 address (is the 6 address an fe80 link local one?) Then distcc is trying to connect to the ipv6 address, but there is a bug in distcc making it fail.

When host stops returning ipv6 addresses it just tried to connect to the v4 and works.

This is a bug in distcc, the easiest workaround is to add special ipv4 only hostnames to your router and use those in your distcc config until someone fixes distcc. No need to disable ipv6

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