Community discussions

MUM Europe 2020
 
User avatar
NetVicious
Member Candidate
Member Candidate
Topic Author
Posts: 118
Joined: Fri Nov 13, 2009 3:30 pm
Location: Spain

DHCP client should have one option to set distance of the dynamic route for the network

Wed Feb 12, 2020 7:00 pm

Hi!
On the DHCP client we have one option to set the distance of the default route when the combo "Add Default Route" it's set to yes, but we cannot change the distance of the dynamic route added to the network of the ip address we got from the DHCP server.

This distance it's set to 0, and we cannot change it to other number to overrid it which a static route.

I know it's a bit strange, but I had one device in a network (A) with the same network address I use in another place (B), and I want to override some /32 ips to route they to the B network instead of the A network.

I tried using routing_marks but it doesn't works. Any tip?
/ip route> print
Flags: X - disabled, A - active, D - dynamic, 
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, 
B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 1 ADS  0.0.0.0/0          192.168.0.1                            10
 4 ADC  192.168.0.0/24     192.168.0.100   ether1_WAN             0
. . //\/ e t . \/ i c i o u s ..
 
Sob
Forum Guru
Forum Guru
Posts: 5111
Joined: Mon Apr 20, 2009 9:11 pm

Re: DHCP client should have one option to set distance of the dynamic route for the network

Wed Feb 12, 2020 7:20 pm

It works. Route #17 is connected route from DHCP and route #18 is static:
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
...
17 ADC  192.168.80.0/24    192.168.80.67   internal                  0
18 A S  192.168.80.1/32                    test2                     1
And with logging rule in postrouting, ping to 192.168.80.1 shows outgoing interface test2:
18:14:55 firewall,info postrouting: in:(unknown 0) out:test2, proto ICMP (type 8, code 0), 192.168.80.67->192.168.80.1, len 56
In other words, static route won.
People who quote full posts should be spanked with ethernet cable. Some exceptions for multi-topic threads may apply. Not intended as incentive for masochists.

Who is online

Users browsing this forum: deathandtaxes, inetwifinetwork, Larsa, r00t and 133 guests