ubuntu disable ipv6, avahi-daemon

ipv6沒在用還開著可能使網路變慢
sudo vi /etc/sysctl.conf

1
2
3
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

sudo sysctl -p #立即套用設定
reboot

ip a | grep inet6 #沒內容就已經關閉ipv6了

disable avahi-daemon

透過 Zeroconf 自動的分析與管理網路。 可以關閉他
systemctl list-units —all | grep avahi-daemon
systemctl stop avahi-daemon.service
systemctl stop avahi-daemon.socket
systemctl disable avahi-daemon.service avahi-daemon.socket
netstat -atunp