LXC (Ubuntu) Disable IPv6

r371769

Member
Feb 23, 2020
9
0
6
58
Hi,

I want to disable IPv6, because I want to setup samba as actice directory service. For this it's needed to disable IPv6.

How can I disable the LXC container to get any IPv6 adress?

regards
Frank
 
You can config samba to use IPv4 only.
Code:
interfaces = your.ipv4.network.address
bind interfaces only = Yes

But if you insist in disabling IPv6 at SO level
I think you could edit /etc/sysctl.conf (not tried yet)
Bash:
$ sudo nano /etc/sysctl.conf
   # add these lines at bottom
    net.ipv6.conf.all.disable_ipv6 = 1 
    net.ipv6.conf.default.disable_ipv6 = 1 
    net.ipv6.conf.lo.disable_ipv6 = 1
Save and close, reboot.

A possible caveat is that if you plan to use X Forwarding through ssh, disabling IPv6 can break it.
Also if you're using postfix, also will fail.
You'll have to point to your IPv4 loopback