You are not logged in.

#1 2018-08-29 18:26:24

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,688
Website

Systemd-networkd for pure ipv4 yet still gets ipv6 assigned [SOLVED]

I'd like to configure systemd-networkd to assign a pure ipv4 address to my PC.  From this wiki article, one should configure it like this:

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

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

I still seem to be getting an ipv6 address assigned and am wondering why:

% ip a
...
2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 6c:f0:49:0a:0d:12 brd ff:ff:ff:ff:ff:ff
    inet 10.1.10.102/24 brd 10.1.10.255 scope global dynamic enp4s0
       valid_lft 43199sec preferred_lft 43199sec
    inet6 fe80::6ef0:49ff:fe0a:d12/64 scope link 
       valid_lft forever preferred_lft forever

Last edited by graysky (2018-08-29 19:55:15)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2018-08-29 18:50:45

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Systemd-networkd for pure ipv4 yet still gets ipv6 assigned [SOLVED]

I think that is ipv6 autoconf, which can be disabled via sysctl.

Offline

#3 2018-08-29 19:31:28

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,688
Website

Re: Systemd-networkd for pure ipv4 yet still gets ipv6 assigned [SOLVED]

@brebs - I have been doing that but feel that it might be the nuclear option... seems like systemd-networkd should honor some how, no?  Perhaps I am mistaken.  I will say that running with the following causes a delay in my nfs share start up.

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

Last edited by graysky (2018-08-29 19:31:59)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2018-08-29 19:48:05

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Systemd-networkd for pure ipv4 yet still gets ipv6 assigned [SOLVED]

If you want to ignore ipv6, then just use e.g.:

# grep ipv6 /etc/default/grub 
GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable_ipv6=1"

... and run "update-grub".

Or do you want something more subtle?

Sysctl entries are for the kernel, whereas systemd is userland.

Offline

#5 2018-08-29 19:51:29

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: Systemd-networkd for pure ipv4 yet still gets ipv6 assigned [SOLVED]

systemd-networkd should be able to set this setting to disabled as well

https://jlk.fjfi.cvut.cz/arch/manpages/ … ESCRIPTION
       Note that an interface without any static IPv6 addresses configured,
       and neither DHCPv6 nor IPv6LL enabled, shall be considered to have no
       IPv6 support. IPv6 will be automatically disabled for that interface by
       writing "1" to /proc/sys/net/ipv6/conf/ifname/disable_ipv6.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2018-08-29 19:54:52

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,688
Website

Re: Systemd-networkd for pure ipv4 yet still gets ipv6 assigned [SOLVED]

@progandy - Eureka!  That did the trick and without the delay to my nfs server.  Thanks!


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#7 2018-08-29 19:56:27

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Systemd-networkd for pure ipv4 yet still gets ipv6 assigned [SOLVED]

I would say that is not systemd's fault. As long as you have ipv6 enabled (and don't tweak anything) I suppose you will get a link local address, see [1].

[1] https://en.wikipedia.org/wiki/Link-local_address#IPv6


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

Board footer

Powered by FluxBB