Community discussions

MikroTik App
 
VolleyTom
just joined
Topic Author
Posts: 14
Joined: Fri Mar 27, 2020 7:06 pm

RouterOS 6: Add IP from Default Gateway to VRF Default Route

Wed Oct 05, 2022 4:25 pm

Hello,
I'm getting from my provider the IP of my WAN-Port via DHCP (e.g. 20.1.1.2/24) and I have a default route in my main VRF to the provided gateway (20.1.1.1).
Now I would like to add to my VRF "Guest" a default route, that the internet is reachable from this VRF, this is done via
/ip route add routing-mark=Guest dst-address=0.0.0.0/0 gateway=1.1.1.1@main

Is there a possibility to not "hardcode" the gateway-IP to the VRF-default route.
Thanks for your help
Tom
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6815
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: RouterOS 6: Add IP from Default Gateway to VRF Default Route

Wed Oct 05, 2022 4:34 pm

Not really sure how it is supposed to work, route requires the gateway with @vrf you are just specifying in which table to resolve the gateways IP.
 
VolleyTom
just joined
Topic Author
Posts: 14
Joined: Fri Mar 27, 2020 7:06 pm

Re: RouterOS 6: Add IP from Default Gateway to VRF Default Route

Wed Oct 05, 2022 4:36 pm

But if I receive the Gateway via DHCP, how should I configure this? Is it required to change this manually every time?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6815
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: RouterOS 6: Add IP from Default Gateway to VRF Default Route

Wed Oct 05, 2022 4:38 pm

It can be done by running a script on a dhcp client. You can get the received gateway from there and add the route or change the existing route.

Who is online

Users browsing this forum: No registered users and 8 guests