Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 21964

General • DHCP Client Default Route in VRF Missing @vrf Suffix on Gateway

$
0
0
I have configured a VRF (vrf-LTE) on my MikroTik router and assigned ether2 to it. When I add a DHCP client on ether2, the default route is initially placed in the main routing table instead of vrf-LTE.

To fix this, I set the default-route-table option in the DHCP client to vrf-LTE. This successfully moves the default route to the correct VRF table. However, the gateway does not include the @vrf-LTE suffix, making it unreachable.
Version 7.18.2
Steps to Reproduce:

Create a VRF and assign ether2 to it:
Code:
/ip/vrf/add interfaces=ether2 name=vrf-LTE  
Add a DHCP client on ether2 with default-route-table=vrf-LTE:
Code:
    /ip/dhcp-client/add interface=ether2 add-default-route=yes default-route-table=vrf-LTE  


Code:
@MikroTik] /ip/route> print where routing-table=vrf-LTE Flags: D - DYNAMIC; I - INACTIVE, A - ACTIVE; c - CONNECT, s - STATIC, d - DHCPColumns: DST-ADDRESS, GATEWAY, DISTANCE #     DST-ADDRESS         GATEWAY          DISTANCE   DId 0.0.0.0/0           192.168.1.1         1   DAc 192.168.1.0/29  ether2@vrf-LTE          0




Observe the default route appearing in vrf-LTE, but the gateway is missing the @vrf-LTE suffix.

Expected Behavior:

The default route should be created in vrf-LTE with the gateway properly formatted as GATEWAY_IP@vrf-LTE.

Actual Behavior:

The gateway is missing the @vrf-LTE suffix, making the route unreachable.

Workaround (Temporary Fix):

Manually add the correct default route:
Code:
    /ip/route/add dst-address=0.0.0.0/0 gateway=GATEWAY_IP@vrf-LTE routing-table=vrf-LTE  
Request:
Could this behavior be fixed so that the DHCP-acquired gateway is automatically assigned to the correct VRF?

Statistics: Posted by irghost — Thu Mar 27, 2025 11:39 pm



Viewing all articles
Browse latest Browse all 21964

Trending Articles