Skip to content
Thuan Bui's Blog
Go back

[Proxmox] Kích hoạt IPv6 cho Debian / Ubuntu LXC

Trước đây khi cài đặt app bằng Helper Scripts, mình thường tắt tính năng IPv6 vì không có nhu cầu sử dụng. Nhưng giờ do mạng ở nhà đã được hỗ trợ IPv6 nên cần kích hoạt lại IPv6 cho LXC Container.

1. Kích hoạt IPv6 cho Debian LXC

Kiểm tra IPv6

Terminal window
ip addr | grep inet6

Nếu không thấy hiện ra kết quả gì nghĩa là IPv6 đang bị vô hiệu hóa.

Chỉnh sửa file này

Terminal window
nano /etc/sysctl.conf

Kéo xuống cuối cùng, nếu thấy dòng net.ipv6.conf.all.disable_ipv6 = 1 thì xóa nó đi và lưu lại.

Khởi động lại LXC bằng lệnh reboot

Giờ kiểm tra lại bằng lệnh ip addr | grep inet6, sẽ thấy hiện ra 1 loạt kết quả

inet6 ::1/128 scope host noprefixroute
inet6 2405:6587:xxxx:yyyy:be24:11ff:feee:b784/64 scope global dynamic mngtmpaddr
inet6 fe80::be24:11ff:feee:b784/64 scope link
inet6 fd7a:115c:a1e0::5001:a610/128 scope global
inet6 fe80::e100:2cd1:2da:c9a/64 scope link stable-privacy
inet6 fe80::42:9ff:fe28:332c/64 scope link
inet6 fe80::42:13ff:feac:de49/64 scope link
inet6 fe80::42:55ff:fece:14d6/64 scope link
inet6 fe80::600b:90ff:fee7:de2b/64 scope link
inet6 fe80::787b:fff:fe28:f77a/64 scope link
inet6 fe80::8084:7eff:fedd:9b0d/64 scope link
inet6 fe80::508b:d4ff:feaa:7f5b/64 scope link
inet6 fe80::80b9:e3ff:fe40:9f22/64 scope link

Trong đó dòng số 2 chính là Public IPv6 của em LXC này.

inet6 2405:6587:xxxx:1300:yyyy:11ff:feee:b784/64 scope global dynamic mngtmpaddr

2. Kích hoạt IPv6 cho Ubuntu LXC

Kiểm tra IPv6

Terminal window
ip addr | grep inet6

thì chỉ thấy hiện ra Local IPv6

inet6 ::1/128 scope host
inet6 fe80::be24:11ff:fee3:cd74/64 scope link

Chỉnh sửa file /etc/systemd/network/eth0.network, đổi giá trị của mục IPv6AcceptRA từ false thành true

[Match]
Name = eth0
[Network]
Description = Interface eth0 autoconfigured by PVE
Address = 192.168.0.206/24
Gateway = 192.168.0.1
DHCP = no
IPv6AcceptRA = true

Tạo thêm 1 file .pve-ignore.eth0.network để ngăn Proxmox tự động đổi giá trị IPv6AcceptRA thành lại thành false mỗi khi khởi động LXC.

Terminal window
touch /etc/systemd/network/.pve-ignore.eth0.network

Khởi động lại LXC

reboot

Kiểm tra lại, IPv6 đã hiện ra ngon lành.

inet6 2405:6587:xxxx:yyyy:be24:11ff:fee3:cd74/64 scope global dynamic mngtmpaddr noprefixroute

Tham khảo:No IPV6 for LXC container | Proxmox Support Forum


Share this post on:

Previous Post
WireHole-UI - Thiết lập VPN Server tích hợp tính năng chặn quảng cáo
Next Post
File Browser - Công cụ quản lý tập tin và thư mục bằng giao diện web