hi Team.
I've been testing an issues with regarding removing the dhcp address on an interface .By default it removes the DF associate to next-hop , but if I add a static route with the same next-hop , it's also removed .therefore , loses the internet connectivity /any network known through the default route. let me show:
version vyos 1.2.8:
vyos@vyos# run show version Version: VyOS 1.2.8 Release Train: crux Built by: Sentrium S.L. Built on: Mon 21 Jun 2021 17:21 UTC Build UUID: 0acd8f9d-7cd3-48b7-b9c8-64d83e6183a0 Build Commit ID: 4ed04df4311601 Architecture: x86_64 Boot via: installed image System type: KVM guest Hardware vendor: QEMU Hardware model: Standard PC (i440FX + PIIX, 1996) Hardware S/N: Unknown Hardware UUID: Unknown Copyright: VyOS maintainers and contributors
i add a DF with the same next-hop:
vyos@vyos# run show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued route, r - rejected route S>* 0.0.0.0/0 [210/0] via 192.168.122.1, eth0, 00:00:48 C>* 192.168.122.0/24 is directly connected, eth0, 00:00:50 [edit] vyos@vyos# run show interfaces Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down Interface IP Address S/L Description --------- ---------- --- ----------- eth0 192.168.122.189/24 u/u eth1 - u/u eth2 - u/u eth3 - u/u lo 127.0.0.1/8 u/u ::1/128 vyos@vyos# set protocols static route 0.0.0.0/0 next-hop 192.168.122.1 [edit] vyos@vyos# commit vyos@vyos# run show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued route, r - rejected route S>* 0.0.0.0/0 [1/0] via 192.168.122.1, eth0, 00:00:23 C>* 192.168.122.0/24 is directly connected, eth0, 00:04:25 [edit]
So I add a new ipv4 address and remove the dhcp services :
vyos@vyos# set interfaces ethernet eth0 address 192.168.122.150/24 [edit] vyos@vyos# delete interfaces ethernet eth0 address dhcp [edit] vyos@vyos# compare [edit interfaces ethernet eth0] -address dhcp +address 192.168.122.150/24 [edit] vyos@vyos# commit [ interfaces ethernet eth0 address dhcp ] Stopping DHCP client on eth0 ...
we can see that it removes the static/DF :
vyos@vyos# run show ip route Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP, T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR, f - OpenFabric, > - selected route, * - FIB route, q - queued route, r - rejected route C>* 192.168.122.0/24 is directly connected, eth0, 00:00:19 [edit]
when you use AWS the default interface is on dhcp , so you want to change a static' ipv4 , you have the same problem.