[READ-ONLY] Mirror of https://github.com/FoxxMD/blog. blog.foxxmd.dev
0

Configure Feed

Select the types of activity you want to include in your feed.

Add more info on disabling 121 for target marchine

FoxxMD (Sep 8, 2025, 7:45 PM UTC) ec1b8427 31fde54b

+28 -3
+28 -3
_drafts/netbird-and-docker.md
··· 46 46 Can use [DHCPCD or DHCLIENT hooks](https://netbeez.net/blog/linux-dhcp-hooks-network-engineers/) to setup a script to delete the route when the associated interface comes up: 47 47 48 48 ```shell 49 - #!/bin/bash 50 - 51 - if [[ "$interface" == "ensX" ]] 49 + if [ "$interface" == "ensX" ] 52 50 then 53 51 echo -e "\nRemoving extra routes" 54 52 ip route del 100.110.0.0/16 via 192.168.0.X dev ensX 55 53 fi 56 54 ``` 55 + 56 + Or try running after interface is up with systemd 57 + 58 + ``` 59 + [Unit] 60 + Description=Drop static route 61 + After=ifup@ens18.service 62 + 63 + [Service] 64 + # the - forces systemd to ignore error from command if route doesn't exist 65 + ExecStart=-ip route del 100.110.0.0/16 via 192.168.0.X dev ens18 66 + 67 + [Install] 68 + WantedBy=multi-user.target 69 + ``` 70 + 71 + Neither of the above ended up working for me...the route seems to be added *after* the interface is up but I can't figure out where in the system boot up lifecycle. 72 + 73 + The only thing did work for me was disabling *all* dhcp option 121 functionality by editing `dhclient` config and commenting out this line: 74 + 75 + ```diff 76 + -option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; 77 + +#option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; 78 + ``` 79 + {: file='/etc/dhcp/dhclient.conf'} 80 + 81 + This is not ideal but it works, for now. 57 82 58 83 ## Test Routing 59 84