-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md.bak
843 lines (614 loc) · 21.4 KB
/
README.md.bak
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
> [!warning]
> All those steps have only been tested on Debian 12
>
> You might need to adapt on other distribution or version
You will find a more detailled version of the nftable configuration [here](nftable.md)
There is also a guide to add netdata (monitoring) [here](netdata.md)
# Interface rename
## WAN
> nano /etc/systemd/network/10-wan.link
```bash
[Match]
MACAddress=xx:xx:xx:xx:xx:xx
[Link]
Name=wan
```
where `xx:xx:xx:xx:xx:xx` correspond to the MAC addr of WAN interface
## LAN
> nano /etc/systemd/network/10-lan.link
```bash
[Match]
MACAddress=xx:xx:xx:xx:xx:xx
[Link]
Name=lan
```
where `xx:xx:xx:xx:xx:xx` correspond to the MAC addr of LAN interface
# Tooling & drivers
## Necessary packages
> apt install git curl zsh htop rsyslog ethtool tcpdump conntrack net-tools iproute2 vlan cgroup-tools isc-dhcp-server radvd
## Optional packages
In UEFI it seem plymouth is not installed. It show Starting service [OK] / [Failed] on startup.
> apt install plymouth
## Oh-My-Zsh (Optional)
> sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Interface configuration
## LAN
> nano /etc/network/interfaces.d/lan
```bash
# LAN
allow-hotplug lan
iface lan inet static
address 192.168.1.1/24
```
## WAN
### DHCP
> nano /etc/dhcp/dhclient-orange-generator
```bash
#!/bin/bash
LOGIN='fti/XXXXXX'
PASSWORD='YYYYYY'
LIVEBOX_VERSION=5
LIVEBOX_HARDWARE='sagem'
# Forge DHCP option 90
tohex() {
for h in $(echo $1 | sed "s/\(.\)/\1 /g"); do printf %02x \'$h; done
}
addsep() {
echo $(echo $1 | sed "s/\(.\)\(.\)/:\1\2/g")
}
r=$(dd if=/dev/urandom bs=1k count=1 2>&1 | md5sum | cut -c1-16)
id=${r:0:1}
h=3C12$(tohex ${r})0313$(tohex ${id})$(echo -n ${id}${PASSWORD}${r} | md5sum | cut -c1-32)
# vendor class
export VENDOR_CLASS_IDENTIFIER_4=${LIVEBOX_HARDWARE}
export VENDOR_CLASS_IDENTIFIER_6=00:00:04:0e:00:05$(addsep $(tohex ${LIVEBOX_HARDWARE}))
echo "Vendor class has been generated"
# user class
export USER_CLASS_4=+FSVDSL_livebox.Internet.softathome.Livebox${LIVEBOX_VERSION}
export USER_CLASS_6=00$(addsep $(tohex "+FSVDSL_livebox.Internet.softathome.Livebox${LIVEBOX_VERSION}"))
echo "User class has been generated"
# option 90
export AUTHENTICATION_STR=00:00:00:00:00:00:00:00:00:00:00:1a:09:00:00:05:58:01:03:41:01:0d$(addsep $(tohex ${LOGIN})${h})
echo "Option 90 has been generated"
# Generate DHCP client (ivp4 and ivp6) files
envsubst < /etc/dhcp/dhclient-orange-v4.conf.template > /etc/dhcp/dhclient-orange-v4.conf
envsubst < /etc/dhcp/dhclient-orange-v6.conf.template > /etc/dhcp/dhclient-orange-v6.conf
```
> [!important]
> Replace `XXXXXX`, `YYYYYY`, `Livebox version` and `Livebox hardware` with the proper values
> chmod 750 /etc/dhcp/dhclient-orange-generator
> nano /etc/dhcp/dhclient-orange-v4.conf.template
```bash
# Debug: tcpdump -i wan port 67 or port 68 -e -n -v
# Definition
option user-class code 77 = string;
option authentication code 90 = string;
# Send Option
send dhcp-parameter-request-list 1, 3, 6, 15, 28, 51, 58, 59, 90, 119, 120, 125;
# Uncomment for absolutly no Orange domain/dns/server-name related
#send dhcp-parameter-request-list 1, 3, 28, 51, 58, 59, 90, 120, 125;
send vendor-class-identifier "${VENDOR_CLASS_IDENTIFIER_4}";
send dhcp-client-identifier = hardware; # equivalent to 01:xx:xx:xx:xx:xx:xx but use mac specified on interface (cf. hw-mac-address on iface)
send user-class "${USER_CLASS_4}";
send authentication ${AUTHENTICATION_STR};
# Uncomment to avoid getting Orange DNS servers
#supersede domain-name "aaaa.bbbb.cc";
#supersede domain-search "aaaa.bbbb.cc";
#supersede domain-name-servers xxx.xxx.xxx.xxx;
```
> nano /etc/dhcp/dhclient-orange-v6.conf.template
```bash
# Debug: tcpdump -i wan port 546 or port 547 -e -n -v
# Definition
option dhcp6.vendorclass code 16 = string;
option dhcp6.userclass code 15 = string;
option dhcp6.auth code 11 = string;
# Send Option
# 73:61:67:65:6d == sagem
send dhcp6.vendorclass ${VENDOR_CLASS_IDENTIFIER_6};
# 2b:46:53:56:44:53:4c:5f:6c:69:76:65:62:6f:78:2e:49:6e:74:65:72:6e:65:74:2e:73:6f:66:74:61:74:68:6f:6d:65:2e:4c:69:76:65:62:6f:78:35 == "+FSVDSL_livebox.Internet.softathome.Livebox5"
send dhcp6.userclass ${USER_CLASS_6};
# auth str
send dhcp6.auth $AUTHENTICATION_STR;
request dhcp6.auth, dhcp6.vendorclass, dhcp6.userclass;
```
> nano /etc/dhcp/dhclient-enter-hooks.d/ipv6-internal
```bash
#!/bin/bash
RUN="yes"
if [ "$RUN" = "yes" ] && [ -n "$new_ip6_prefix" ] && [ -n "$interface_internal" ]
then
prefix="${new_ip6_prefix%00::/*}"
for interface_index in $interface_internal
do
interface="${interface_index%:*}"
index="${interface_index#*:}"
echo ""
echo "========================="
echo "| interface: $interface"
echo "========================="
echo "| prefix: $prefix"
echo "| index: $index"
echo "| ipv6: $prefix$index::1/64"
echo "========================="
ip -family inet6 address flush dev "$interface" scope global
ip -family inet6 address add "$prefix$index::1/64" dev "$interface"
# Automatically associate a subnet6 corresponding to lan IVP6 address subnet
if [ "$interface" = "lan" ]
then
export IPV6_DELEGATION_64=$prefix$index
echo ""
echo "*************************"
echo "* Configuring isch-dhcp-server IPV6 delegation for subnet6=$IPV6_DELEGATION_64"
envsubst < /etc/dhcp/dhcpd6.conf.template > /etc/dhcp/dhcpd6.conf
fi
done
fi
```
> chmod 750 /etc/dhcp/dhclient-enter-hooks.d/ipv6-internal
### Interface
> nano /etc/network/wait_for_wan
```bash
#!/bin/bash
TIMEOUT=120
echo "Waiting for ONU to be UP and running"
until ip addr show wan | grep -q "state UP"
do
sleep 2
if [[ $SECONDS -ge $TIMEOUT ]]
then
echo "Timeout ($TIMEOUT second) waiting for ONU module to be UP"
exit 1
fi
done
echo "ONU UP and running"
```
> chmod 750 /etc/network/wait_for_wan
> nano /etc/network/interfaces.d/wan
```bash
# WAN
auto wan
allow-hotplug wan
iface wan inet manual
# VLAN832
auto vlan832
allow-hotplug vlan832
iface vlan832 inet manual
# Bind vlan
vlan-raw-device wan
# LiveBox mac address
hw-mac-address xx:xx:xx:xx:xx:xx
# Wait for ONU to be UP
up /etc/network/wait_for_wan
# Generate Orange Options (user-class, vendor-class, option 90)
up /etc/dhcp/dhclient-orange-generator
# Egress prio 6:6
up ip l s $IFACE type vlan egress 6:6
# CGroup Up
up mkdir -p /sys/fs/cgroup/net_prio && mount -t cgroup -o net_prio net_prio /sys/fs/cgroup/net_prio 2>/dev/null || true
up cgcreate -g net_prio:dhcp-orange
up cgset -r "net_prio.ifpriomap=$IFACE 6" dhcp-orange
# DHCP Up
up cgexec -g net_prio:dhcp-orange --sticky -- dhclient -4 -i $IFACE -cf /etc/dhcp/dhclient-orange-v4.conf -df /var/lib/dhcp/dhclient-orange-v4.duid -lf /var/lib/dhcp/dhclient-orange-v4.lease -v
up sleep 2
up cgexec -g net_prio:dhcp-orange --sticky -- dhclient -6 -P -D LL -i $IFACE -cf /etc/dhcp/dhclient-orange-v6.conf -df /var/lib/dhcp/dhclient-orange-v6.duid -lf /var/lib/dhcp/dhclient-orange-v6.lease -e interface_internal="$IFACE:01 lan:02" -v
# DHCP Down
down cgexec -g net_prio:dhcp-orange --sticky -- dhclient -6 -P -D LL -i $IFACE -cf /etc/dhcp/dhclient-orange-v6.conf -df /var/lib/dhcp/dhclient-orange-v6.duid -lf /var/lib/dhcp/dhclient-orange-v6.lease -e interface_internal="$IFACE:01 lan:02" -v -r
down sleep 2
down cgexec -g net_prio:dhcp-orange --sticky -- dhclient -4 -i $IFACE -cf /etc/dhcp/dhclient-orange-v4.conf -df /var/lib/dhcp/dhclient-orange-v4.duid -lf /var/lib/dhcp/dhclient-orange-v4.lease -v -r
# CGroup down
down cgdelete -g net_prio:dhcp-orange
down umount /sys/fs/cgroup/net_prio 2>/dev/null || true
```
> [!important]
> Replace `xx:xx:xx:xx:xx:xx` with the Livebox mac address
# DHCP server
> apt install isc-dhcp-server
> nano /etc/default/isc-dhcp-server
```bash
INTERFACESv4="lan"
INTERFACESv6="lan"
```
## DHCP IPV4 server
> nano /etc/dhcp/dhcpd.conf
```bash
##################
#### Config
# Global config
option domain-name "aaaa.bbbb.cc";
option ldap-server code 95 = text;
option arch code 93 = unsigned integer 16; # RFC4578
option pac-webui code 252 = text;
# MTU flag
option mtu-flag code 26 = unsigned integer 16;
# Lease config
default-lease-time 7200;
max-lease-time 86400;
log-facility local7;
one-lease-per-client true;
deny duplicates;
ping-check true;
update-conflict-detection false;
authoritative;
# Subnet
subnet 192.168.1.0 netmask 255.255.255.0 {
# Invite pool range
pool {
option domain-name-servers 192.168.1.xxx;
range 192.168.1.xxx 192.168.1.xxx;
}
option routers 192.168.1.1;
option domain-name "aaaa.bbbb.cc";
option domain-search "aaaa.bbbb.cc";
option domain-name-servers 192.168.1.xxx;
# MTU 9000 (optional)
#option mtu-flag 9000;
}
##################
#### Lease
# XXXXXXX
host XXXXXXX {
hardware ethernet xx:xx:xx:xx:xx:xx;
fixed-address 192.168.1.XXX;
option host-name "XXXXXXX";
set hostname-override = config-option host-name;
}
# YYYYYYY
host YYYYYYY {
hardware ethernet xx:xx:xx:xx:xx:xx;
option dhcp-client-identifier "YYYYYYY";
fixed-address 192.168.1.XXX;
option host-name "YYYYYYY";
set hostname-override = config-option host-name;
}
...
```
> [!important]
> Replace placeholders value with proper values
## DHCP IPV6 server & Radvd
> nano /etc/dhcp/dhcpd6.conf.template
```bash
##################
#### Config
# Global config
option dhcp6.domain-search "aaaa.bbbb.cc";
option dhcp6.rapid-commit;
# Lease config
default-lease-time 7200;
max-lease-time 86400;
log-facility local7;
one-lease-per-client true;
deny duplicates;
ping-check true;
update-conflict-detection false;
authoritative;
# Subnet
subnet6 ${IPV6_DELEGATION_64}::/64 {
# Invite pool range
range6 ${IPV6_DELEGATION_64}::aaaa ${IPV6_DELEGATION_64}::bbbb;
# DNS
option dhcp6.name-servers ${IPV6_DELEGATION_64}::dddd;
}
ddns-update-style none;
##################
#### Lease
# XXXXXX
host XXXXXX {
host-identifier option dhcp6.client-id xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx;
fixed-address6 ${IPV6_DELEGATION_64}::eeee;
}
# YYYYYY
host YYYYYY {
host-identifier option dhcp6.client-id xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx;
fixed-address6 ${IPV6_DELEGATION_64}::ffff;
}
...
```
> [!important]
> Replace placeholders value with proper values
# Radvd
> nano /etc/radvd.conf
```bash
# LAN
interface lan {
# A flag indicating whether or not the router sends periodic router advertisements and responds to router solicitations.
AdvSendAdvert on;
# The minimum time allowed between sending unsolicited multicast router advertisements
MinRtrAdvInterval 200;
# The maximum time allowed between sending unsolicited multicast router advertisements
MaxRtrAdvInterval 600;
# MTU
AdvLinkMTU 1500;
#AdvLinkMTU 9000;
# The preference associated with the default router
AdvDefaultPreference medium;
# Hosts use the administered (stateful) protocol for address autoconfiguration
AdvManagedFlag on;
# Hosts use the administered (stateful) protocol for autoconfiguration of other (non-address) information
AdvOtherConfigFlag on;
prefix ::/64 {
DeprecatePrefix on;
# When set, indicates that this prefix can be used for on-link determination
AdvOnLink on;
# When set, indicates that this prefix can be used for autonomous address configuration as specified in RFC 4862.
AdvAutonomous off;
};
# Broadcast DNS server
RDNSS xxxx:xxxx:xxxx::xxxx xxxx:xxxx:xxxx::xxxx {
};
# Broadcast domain
DNSSL aaaa.bbbb.cc {
};
};
```
> [!important]
> Replace placeholders value with proper values
# Tooling
Add manufacturer database for MAC address
> wget http://standards-oui.ieee.org/oui.txt
>
> mv oui.txt /usr/local/etc/
To print out the current ipv4 used lease
> dhcp-lease-list
# Routing
## Enable nftables
> systemctl enable nftables.service
## Configure nftables
> nano /etc/nftables.conf
```bash
#!/usr/sbin/nft -f
flush ruleset
define LAN_IPV4_SUBNET = { 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 }
define LAN_IPV6_SUBNET = { xxxx:xxxx:xxxx:xxxx::/64 }
# NAT
table ip nat {
chain prerouting {
type nat hook prerouting priority 0; policy accept;
#############################################
# Example Forward
# WAN(80/443) => IP LAN(80/443)
#iifname "vlan832" tcp dport { http, https } dnat to 192.168.1.xxx comment "Web Redirect"
}
chain input {
type nat hook input priority 0; policy accept;
#counter comment "count accepted packets"
}
chain output {
type nat hook output priority 0; policy accept;
#counter comment "count accepted packets"
}
chain postrouting {
type nat hook postrouting priority 0; policy accept;
oifname "vlan832" masquerade;
#counter comment "count accepted packets"
#counter log prefix "nft#nat: "
}
}
# Filter IPV4
table ip filter {
chain input {
type filter hook input priority filter; policy drop;
iif lo accept
ct state { related, established } accept
iifname "lan" ip saddr $LAN_IPV4_SUBNET accept # From LAN to WAN
}
chain forward {
type filter hook forward priority filter; policy drop;
ct state { related, established } accept
ct state invalid drop
iifname "lan" ct state new accept # From LAN to WAN (NAT)
oifname "lan" ip daddr $LAN_IPV4_SUBNET accept # From WAN to LAN
}
chain output {
type filter hook output priority filter; policy accept;
}
}
# Filter IPV6
table ip6 filter {
chain input {
type filter hook input priority filter; policy drop;
iif lo accept
ct state { related, established } accept
iifname "lan" ip6 saddr fe80::/64 accept # Accept ip6 local
iifname "lan" ip6 saddr $LAN_IPV6_SUBNET accept # Accept ip6 subnet
# Orange Advert & Solicit
iifname "vlan832" ip6 daddr fe80::/64 udp dport { 546 } accept # Accept Orange DHCP Advertise & Reply
iifname "vlan832" icmpv6 type { nd-neighbor-solicit, nd-router-advert, nd-neighbor-advert } accept # Solicit, Advert from Orange on WAN
}
chain forward {
type filter hook forward priority filter; policy drop;
ct state { related, established } accept
ct state invalid drop
iifname "lan" ct state new accept
#############################################
# Example IPV6 Filtering
#############################################
# Accept ping on all IPV6 in subnet
ip6 daddr $LAN_IPV6_SUBNET icmpv6 type { echo-request } accept
}
chain output {
type filter hook output priority filter; policy accept;
}
}
```
> [!important]
> Replace placeholders value with proper values
## Configure nftables with fastpath (optional)
This part is totally optional and doesn't need to be done for the connection to work.
It is more an optimisation (especially for XGS-PON) than anything else.
> [!warning]
> Adding fastpath on nftable explicitely declare lan and vlan832
>
> Thus making impossible to load nftable rule that include fastpath unless vlan832 iface is up
>
> To prevent that we will use an update script that add those rules when the vlan832 is up
> nano /etc/network/inject_flowtable_fastpath
```bash
#!/bin/bash
# Reload nftable
nft -f /etc/nftables.conf
# Add flowtable fastpath
nft add "flowtable ip filter fastpath { hook ingress priority 0; devices = { lan, vlan832 }; }"
nft add "flowtable ip6 filter fastpath { hook ingress priority 0; devices = { lan, vlan832 }; }"
echo "flowtable fastpath added to nftable rules"
# Add flowtable usage
nft insert "rule ip filter forward ct state { related, established } meta l4proto { tcp, udp } flow offload @fastpath;"
nft insert "rule ip6 filter forward ct state { related, established } meta l4proto { tcp, udp } flow offload @fastpath;"
echo "flowtable fastpath usage added to nftable rules"
```
> chmod 750 /etc/network/inject_flowtable_fastpath
Then edit interface WAN
> nano /etc/network/interfaces.d/wan
Add `up /etc/network/inject_flowtable_fastpath` to `vlan832` interface
```bash
# VLAN832
auto vlan832
allow-hotplug vlan832
iface vlan832 inet manual
# Bind vlan
vlan-raw-device wan
# LiveBox mac address
hw-mac-address ac:84:c9:0e:f5:e8
# Wait for ONU to be UP
up /etc/network/wait_for_wan
# Add nftable fastpath rules
up /etc/network/inject_flowtable_fastpath
# Generate Orange Options (user-class, vendor-class, option 90)
up /etc/dhcp/dhclient-orange-generator
...
```
## Configure nftables with trace (optional / debug)
### Inject trace rules
> nano /etc/network/inject_trace_nft
```bash
#!/bin/bash
# Inject chain
nft add "chain ip nat trace_chain { type filter hook prerouting priority -1; }"
nft add "chain ip filter trace_chain { type filter hook prerouting priority -1; }"
nft add "chain ip6 filter trace_chain { type filter hook prerouting priority -1; }"
echo "chain trace injected"
# Inject trace rules
nft add "rule ip nat trace_chain meta nftrace set 1"
nft add "rule ip filter trace_chain meta nftrace set 1"
nft add "rule ip6 filter trace_chain meta nftrace set 1"
echo "trace injected"
```
> chmod 750 /etc/network/inject_trace_nft
> /etc/network/inject_trace_nft
>
> nft monitor trace
### Remove trace rules
> nano /etc/network/remove_trace_nft
```bash
#!/bin/bash
# Remove trace rules
nft delete chain ip nat trace_chain
nft delete chain ip filter trace_chain
nft delete chain ip6 filter trace_chain
echo "chain trace removed"
```
> chmod 750 /etc/network/remove_trace_nft
> /etc/network/remove_trace_nft
## IP forward
> nano /etc/sysctl.conf
```
# IP forwarding (IPV4 / IPV6)
net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1
# Desactivate accepting Router Advertisements
net.ipv6.conf.lan.accept_ra=0
# Accept accepting Router Advertisements even when 'net.ipv6.conf.all.forwarding=1' (force Solicitation/Advertisements true)
net.ipv6.conf.default.accept_ra=2
```
## Test
> ifdown vlan832 && ifup vlan832
>
> systemctl restart isc-dhcp-server.service
>
> systemctl restart radvd.service
>
> systemctl restart nftables.service
# Dynamic DNS with DDClient (optional)
## Install
> apt install ddclient dh-autoreconf
> [!important]
> Clone the lastest version of ddclient if the current version is not at least 3.11.3_0
> You don't need to clone if ddclient is more up to date
> [!note]
> Only needed if ddclient is not at least 3.11.3_0
> cd /tmp && git clone https://github.com/ddclient/ddclient.git && cd /tmp/ddclient
>
> ./autogen
>
> ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
>
> make
>
> make install
## Configuration
> nano /etc/ddclient.conf
> [!note]
> Example with gandi
```
ssl=yes
force=yes
protocol=gandi
zone=bbbb.cc
password=<PASSWORD>
usev4=ifv4
usev6=ifv6
ifv4=vlan832
ifv6=vlan832
aaaa.bbbb.cc
```
> [!important]
> Replace placeholders value with proper values
# VerNum activated on startup (optional)
> nano /usr/local/bin/numlock
```bash
#!/bin/bash
for tty in /dev/tty{1..6}
do
/usr/bin/setleds -D +num < "$tty";
done
```
> chmod 755 /usr/local/bin/numlock
> nano /etc/systemd/system/numlock.service
```bash
[Unit]
Description=numlock
[Service]
ExecStart=/usr/local/bin/numlock
StandardInput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
```
> systemctl enable numlock.service
# Debug
## NFtable
> conntrack -L
>
> conntrack -L | grep OFFLOAD
>
> nft -a list ruleset
>
> nft monitor trace
## DHCP
> tcpdump -i wan port 67 or port 68 -e -n -v
>
> tcpdump -i wan port 546 or port 547 -e -n -v
# BMC / BCM57810 (optional)
> [!important]
> All commandes are necessary
> apt install firmware-bnx2x dkms
>
> curl https://raw.githubusercontent.com/JAMESMTL/snippets/master/bnx2x/patches/dkms-init.sh | sudo sh | sudo tee /usr/src/dkms-init.log
>
> curl https://raw.githubusercontent.com/JAMESMTL/snippets/master/bnx2x/patches/dkms-update.sh | sudo sh | sudo tee /usr/src/dkms-update.log
>
> apt remove firmware-bnx2x
>
> curl https://raw.githubusercontent.com/JAMESMTL/snippets/master/bnx2x/patches/dkms-init.sh | sudo sh | sudo tee /usr/src/dkms-init.log
>
> apt install firmware-bnx2x