Sistemul meu rulează Debian GNU/Linux 11 (bullseye)
Rețeaua mea este configurată cu două interfețe, una la ISP-ul meu și una la lan-ul meu.
Folosesc systemd-networkd pentru a gestiona interfețele. Problema este că IPv6 nu este redirecționat. (versiunea de sistem 247.3-6)
Îmi pot da ping -6 în amonte de la router, dar nu de la o gazdă internă. Gazdele interne nu se pot conecta la servere IPv6 externe, dar se pot conecta la servere IPv4 externe printr-o conexiune NAT.
cat /etc/systemd/network/eth0.network
[Meci]
Nume=eth0
[Reţea]
DHCP=da
IPv6AcceptRA=da
IPForward=ipv6
LLDP=da
[DHCPv6]
PrefixDelegationHint=::/56
cat /etc/systemd/network/lan0.network
[Meci]
Nume=lan0
[Reţea]
Adresa=192.168.1.2/24
Adresa=192.168.1.1/24
Adresa=192.168.1.5/24
Adresa=192.0.2.5/24
Adresă=2001:0DB8:c101:b700::1/64
Adresă=2001:0DB8:c101:b700:carne de vită::5/64
Domains=lan example.com
IPForward=ipv6
LLDP=da
ip -6 route show table all
::1 dev lo proto kernel metric 256 pref mediu
2001:0DB8:c101:b700::/64 dev lan0 proto kernel metric 256 pref mediu
fe80::/64 dev eth0 proto kernel metric 256 pref mediu
fe80::/64 dev lan0 proto kernel metric 256 pref mediu
implicit prin fe80::2a2:ff:feb2:c2 dev eth0 proto ra metric 1024 expiră 1724sec mtu 1500 pref high
local ::1 dev lo table local proto kernel metric 0 pref mediu
local 2001:0DB8:c000:1b7:f3d4:d970:ca28:bf4f dev eth0 tabel local proto kernel metric 0 pref mediu
anycast 2001:0DB8:c101:b700:: dev lan0 tabel local proto kernel metric 0 pref mediu
local 2001:0DB8:c101:b700::1 dev lan0 tabel local proto kernel metric 0 pref mediu
local 2001:0DB8:c101:b700:beef::5 dev lan0 table local proto kernel metric 0 pref medium
anycast fe80:: dev eth0 table local proto kernel metric 0 pref medium
anycast fe80:: dev lan0 table local proto kernel metric 0 pref medium
local fe80::fca5:6fff:fe75:6109 dev eth0 table local proto kernel metric 0 pref medium
local fe80::fca5:6fff:fe75:6129 dev lan0 tabel local proto kernel metric 0 pref mediu
multicast ff00::/8 dev eth0 tabel local proto kernel metric 256 pref mediu
multicast ff00::/8 dev lan0 tabel local proto kernel metric 256 pref mediu
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue stare UNKNOWN grup implicit qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft pentru totdeauna preferred_lft pentru totdeauna
inet6 ::1/128 scope host
valid_lft pentru totdeauna preferred_lft pentru totdeauna
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq stare UP grup implicit qlen 1000
link/ether fe:a5:6f:75:61:09 brd ff:ff:ff:ff:ff:ff
inet 192.0.2.199/23 brd 192.0.2.255 scope global dynamic eth0
valid_lft 1602sec preferred_lft 1602sec
inet6 2001:0DB8:c000:1b7:f3d4:d970:ca28:bf4f/128 scope global dynamic noprefixroute
valid_lft 3802sec preferred_lft 2802sec
inet6 fe80::fca5:6fff:fe75:6109/64 scope link
valid_lft pentru totdeauna preferred_lft pentru totdeauna
3: lan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether fe:a5:6f:75:61:29 brd ff:ff:ff:ff:ff:ff
inet 192.0.2.5/24 brd 192.0.2.255 scope global lan0
valid_lft pentru totdeauna preferred_lft pentru totdeauna
inet 192.168.1.1/24 brd 192.168.1.255 scope global lan0
valid_lft pentru totdeauna preferred_lft pentru totdeauna
inet 192.168.1.5/24 brd 192.168.1.255 scope global secondary lan0
valid_lft pentru totdeauna preferred_lft pentru totdeauna
inet6 2001:0DB8:c101:b700:beef::5/64 domeniu global
valid_lft pentru totdeauna preferred_lft pentru totdeauna
inet6 2001:0DB8:c101:b700::1/64 domeniu global
valid_lft pentru totdeauna preferred_lft pentru totdeauna
inet6 fe80::fca5:6fff:fe75:6129/64 scope link
valid_lft pentru totdeauna preferred_lft pentru totdeauna
ip6tables-salvare
# Generat de ip6tables-save v1.8.7 pe Dum Mar 27 06:29:25 2022
*filtru
:INPUT ACCEPT [0:0]
: FORWARD ACCEPT [0:0]
: ACCEPT IEȘIRE [127035:902105282]
:client_in - [0:0]
:client_out - [0:0]
:nameserver_in - [0:0]
:server_in - [0:0]
:server_out - [0:0]
-A INTRARE -m rt --rt-tip 0 -j DROP
-A INTRARE -i lo -j ACCEPT
-A INTRARE -i lan0 -j ACCEPT
-A INTRARE -i lo -j ACCEPT
-A INPUT -m stare --stare RELATED,STABLISHED -j ACCEPT
-A INTRARE -s fe80::/10 -j ACCEPT
-A INTRARE -d ff00::/8 -j ACCEPT
-A INTRARE -p ipv6-icmp -j ACCEPT
-A INTRARE -d 2001:0DB8:c101:b700::1/128 -i eth0 -j nameserver_in
-A INTRARE -d 2001:0DB8:c101:b700::5/128 -i eth0 -j nameserver_in
-A INTRARE -p tcp -m tcp --dport 25 -j ACCEPT
-A INTRARE -p udp -m udp --dport 53 -j ACCEPT
-A INTRARE -p tcp -m tcp --dport 53 -j ACCEPT
-A INTRARE -p tcp -m tcp --dport 80 -j ACCEPT
-A INTRARE -p tcp -m tcp --dport 143 -j ACCEPT
-A INTRARE -p tcp -m tcp --dport 443 -j ACCEPT
-A INTRARE -p tcp -m tcp --dport 587 -j ACCEPT
-A INTRARE -p tcp -m tcp --dport 993 -j ACCEPT
-A INTRARE -j CĂDERARE
-A FORWARD -m rt --rt-type 0 -j DROP
-A FORWARD -m stare --stare RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -p ipv6-icmp -j ACCEPT
-A FORWARD -s 2001:0DB8:c101:b700::/56 -i lan0 -j ACCEPT
-A FORWARD -d 2001:0DB8:c101:b700:beef::/80 -i eth0 -j server_in
-A FORWARD -d 2001:0DB8:c101:b700::/125 -i eth0 -j nameserver_in
-A ÎNTÂMPRE -j PĂDURA
-A IEȘIRE -m rt --rt-tip 0 -j DROP
-A IEȘIRE -o lo -j ACCEPT
-A IEȘIRE -s fe80::/10 -j ACCEPT
-A IEȘIRE -d ff00::/8 -j ACCEPT
-A IEȘIRE -p ipv6-icmp -j ACCEPT
-A client_in -m stare --state RELATED,STABLISHED -j ACCEPT
-A client_out -j ACCEPT
-A nameserver_in -p udp -m udp --dport 53 -j ACCEPT
-A nameserver_in -p tcp -m tcp --dport 53 -j ACCEPT
-A server_in -m stare --state RELATED,STABLISHED -j ACCEPT
-A server_in -p tcp -m tcp --dport 80 -j ACCEPT
-A server_in -p tcp -m tcp --dport 443 -j ACCEPT
-A server_in -p tcp -m tcp --dport 25 -j ACCEPT
-A server_out -j ACCEPT
COMMIT
# Finalizat duminică, 27 martie 06:29:25 2022
starea networkctl lan0
â 3: lan0
Fișier de legătură: /lib/systemd/network/73-usb-net-by-mac.link
Fișier de rețea: /etc/systemd/network/lan0.network
Tip: eter
Stare: rutabil (configurat)
Calea: platform-xhci-hcd.0.auto-usb-0:1:1.0
Driver: r8152
Furnizor: Realtek Semiconductor Corp.
Model: Adaptor Gigabit Ethernet RTL8153
Adresa HW: fe:a5:6f:75:61:29
MTU: 1500 (min: 68, max: 9194)
QDisc: pfifo_fast
Mod de generare a adresei IPv6: eui64
Lungimea cozii (Tx/Rx): 1/1
Negociere automată: da
Viteza: 1 Gbps
Duplex: plin
Port: mii
Adresa: 192.168.1.1
192.168.1.5
192.0.2.5
2001:0DB8:c101:b700::1
2001:0DB8:c101:b700:carne de vită::5
fe80::fca5:6fff:fe75:6129
Domenii de căutare: lan
exemplu.com
27 mar 05:35:20 firewall systemd-networkd[6691]: lan0: IPv6LL obținut
27 mar 05:44:47 firewall systemd-networkd[6750]: lan0: IPv6LL obținut
27 mar 06:19:05 firewall systemd-networkd[7041]: lan0: IPv6LL obținut
starea networkctl eth0
â 2: eth0
Fișier de legătură: /lib/systemd/network/99-default.link
Fișier de rețea: /etc/systemd/network/eth0.network
Tip: eter
Stare: rutabil (configurat)
Calea: platform-ff540000.ethernet
Adresa HW: fe:a5:6f:75:61:09
MTU: 1500 (min: 46, max: 3712)
QDisc: mq
Mod de generare a adresei IPv6: eui64
Lungimea cozii (Tx/Rx): 8/8
Negociere automată: da
Viteza: 1 Gbps
Duplex: plin
Port: tp
Adresă: 192.0.2.199 (DHCP4 prin 202.90.244.1)
2001:0DB8:c000:1b7:f3d4:d970:ca28:bf4f
fe80::fca5:6fff:fe75:6109
Gateway: 202.90.244.1
fe80::2a2:ff:feb2:c2
DNS: 202.142.142.142
202.142.142.242
2001:0DB8:100:1::142
2001:0DB8:1:5::242
ID client DHCP4: IAID:0xa3d03369/DUID
IAID client DHCP6: 0xa3d03369
DUID client DHCP6: DUID-EN/Vendor:0000ab111f00fd4412b87eae0000
27 mar 05:44:47 firewall systemd-networkd[6691]: eth0: lease DHCPv6 pierdut
27 mar 05:44:47 firewall systemd-networkd[6750]: eth0: IPv6LL obținut
27 mar 05:44:50 firewall systemd-networkd[6750]: eth0: adresa DHCPv4 192.0.2.199/23 prin 202.90.244.1
27 mar 05:44:51 firewall systemd-networkd[6750]: eth0: adresa DHCPv6 2001:0DB8:c000:1b7:f3d4:d970:ca28:bf4f/128 timeout preferat 3000 valid 4000
27 mar 06:00:17 firewall systemd-networkd[6750]: eth0: adresa DHCPv6 2001:0DB8:c000:1b7:f3d4:d970:ca28:bf4f/128 timeout preferabil 3000 valid 4000
27 mar 06:15:52 firewall systemd-networkd[6750]: eth0: adresa DHCPv6 2001:0DB8:c000:1b7:f3d4:d970:ca28:bf4f/128 timeout preferat 3000 valid 4000
27 mar 06:19:04 firewall systemd-networkd[6750]: eth0: lease DHCPv6 pierdut
27 mar 06:19:05 firewall systemd-networkd[7041]: eth0: IPv6LL obținut
27 mar 06:19:07 firewall systemd-networkd[7041]: eth0: adresa DHCPv6 2001:0DB8:c000:1b7:f3d4:d970:ca28:bf4f/128 timeout preferat 3000 valid 4000
27 mar 06:19:08 firewall systemd-networkd[7041]: eth0: adresa DHCPv4 192.0.2.199/23 prin 202.90.244
sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
sysctl net.ipv6.conf.all.forwarding
net.ipv6.conf.all.forwarding = 1