Community discussions

MUM Europe 2020
 
anav
Forum Guru
Forum Guru
Topic Author
Posts: 3185
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada

Dynamic DHCP & Recursive

Sun Oct 20, 2019 9:37 pm

I just added dyndns.org script to the router and it works, so since I am on fire now tackling the subject topic. ;-)

My current Ip route schema is as follows (using two internet dns resolving IPs to check that ISP Primary is actually up).
/ip route
(L1) add check-gateway=ping distance=3 gateway=1.0.0.1 (cloudfare)
(L2) add check-gateway=ping distance=4 gateway=208.67.220.220 (opendns)
(L3) add distance=3 dst-address=1.0.0.1/32 gateway=ISP_Primary scope=10
(L4) add distance=4 dst-address=208.67.220.220/32 gateway=ISP_Primary scope=10
(L5) add distance=10 gateway=ISP_Secondary

Two questions:
1. Is the "add distance" in L3,L4 redundant since they are used in L1,L2 ??
2. Should I use actual IP addresses of sites vice the DNS resolver IP addresses, and if so which ones?

Now onto the dynamic part...........
This will be done in two parts,
A. Put in the following script into the DHCP Client for the ISP-PRIMARY.
:if ($bound=1) do={ /ip route set [find comment=" isp1route "] gateway=($"gateway-address")disabled=no; :log warning ("New ISP1 gateway: ".($"gateway-address")) }

The other item to put in is a Default Route Distance of 255. This apparently will pull the route information from the provider but not become an active route.
It should pull the all important new ISP gateway information to add to the route rules.

B. The second part is to transform my current IP Routes to something that will work with the script.

Based upon the advice/example found:
/ip route
add dst-address=8.8.4.4 gateway=127.0.0.1 scope=30 target-scope=30 comment=" isp1route " disabled=yes
add dst-address=0.0.0.0/0 gateway=8.8.4.4 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=ISP_Secondary distance=2

I have modifed my current IP Routes as follows........... and am asking did I screw it up or am I Close ????
(L10) add check-gateway=ping distance=3 dst-address=0.0.0.0/0 gateway=1.0.0.1 (cloudfare)
(L20) add check-gateway=ping distance=4 dst address=0.0.0.0/0 gateway=208.67.220.220 (opendns)
(L30) add distance=3 dst-address=1.0.0.1/32 gateway=127.0.0.1 scope=10 disabled=yes
(L40) add distance=4 dst-address=208.67.220.220/32 gateway=127.0.0.1 scope=10 disabled=yes
(L50) add distance=10 gateway=ISP_Secondary

or is this not possible when checking two different internet addresses and thus should simply stick to one external...........
(L10) add check-gateway=ping distance=3 dst-address=0.0.0.0/0 gateway=1.0.0.1 (cloudfare)
(L30) add distance=3 dst-address=1.0.0.1/32 gateway=127.0.0.1 scope=10 disabled=yes
(L50) add distance=10 gateway=ISP_Secondary
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
 
anav
Forum Guru
Forum Guru
Topic Author
Posts: 3185
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada

Re: Dynamic DHCP & Recursive

Mon Oct 21, 2019 4:02 pm

I was going to post something similar so I will just be patient and wait for the feedback to pile in. ;-)
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
 
anav
Forum Guru
Forum Guru
Topic Author
Posts: 3185
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada

Re: Dynamic DHCP & Recursive

Wed Oct 23, 2019 3:28 am

...
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
 
anav
Forum Guru
Forum Guru
Topic Author
Posts: 3185
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada

Re: Dynamic DHCP & Recursive

Wed Oct 23, 2019 8:21 pm

is the question to basic for the general forum?
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
 
mkx
Forum Guru
Forum Guru
Posts: 3607
Joined: Thu Mar 03, 2016 10:23 pm

Re: Dynamic DHCP & Recursive

Wed Oct 23, 2019 9:20 pm

When I first saw your original post, my mind entered the mid-management mode ... and that is; read first 3 lines of text. If the point of whole text is clear, then do something (e.g. read the rest of it :wink:), else ignore it.

It did the same to me second, third and fourth time. This time I managed to get through ... the last post of yours :wink: I don't dare to try again with the first post though.
BR,
Metod
 
Sob
Forum Guru
Forum Guru
Posts: 5026
Joined: Mon Apr 20, 2009 9:11 pm

Re: Dynamic DHCP & Recursive

Wed Oct 23, 2019 10:19 pm

Yeah, it's not that we wouldn't like you, but some of your questions tend to be quite complex and it takes a long time to understand all details. And I'll admit that recursive routes are not my thing, I understand the idea, I will get it working in the end, but I usually have to "cheat" with manual.
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.
 
Sob
Forum Guru
Forum Guru
Posts: 5026
Joined: Mon Apr 20, 2009 9:11 pm

Re: Dynamic DHCP & Recursive

Wed Oct 23, 2019 10:29 pm

Ok, when I look again, I don't see that you really changed much. Maybe you should highlight changed parts next time, but I see only gateway changed from interface to IP address. So if you add comment="isp1route" to those routes, so that script can find it, it will probably do what you want, assuming that original config did.
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.
 
anav
Forum Guru
Forum Guru
Topic Author
Posts: 3185
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada

Re: Dynamic DHCP & Recursive

Wed Oct 23, 2019 11:40 pm

Thanks I am willing to take any reply at this point LOL.
The difference is that I am going to change from my current recursive setup to one that makes some changes to the DHCP client settings, and IP route settings and then will rely on a script to ensure that the IP route rules work.

Besides that I was asking is putting the distance parts in twice is actually needed or just once.
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
 
Sob
Forum Guru
Forum Guru
Posts: 5026
Joined: Mon Apr 20, 2009 9:11 pm

Re: Dynamic DHCP & Recursive

Thu Oct 24, 2019 12:42 am

If there's more than one route with same dst-address, distance is what tells the router which one should have priority. In your case, only L1 and L2 have same dst-address, so it doesn't do anything useful for L3 and L4. I'd just keep default 1, but in this case it shouldn't matter. I'm not sure about routing protocols like BGP and others, if it would do anything to them, but luckily that's not what you use.

And I remembered another thing about your questions, sometimes you're too curious. Let's put it this way, I know that sun rises in the east, but you'd be able to ask about it in such way that I'd have to stop and think if it really does. :D
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.
 
mkx
Forum Guru
Forum Guru
Posts: 3607
Joined: Thu Mar 03, 2016 10:23 pm

Re: Dynamic DHCP & Recursive

Thu Oct 24, 2019 1:33 am

Curiosity kiled the cat, not anav ... he's killing us :lol:
BR,
Metod
 
anav
Forum Guru
Forum Guru
Topic Author
Posts: 3185
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada

Re: Dynamic DHCP & Recursive

Thu Oct 24, 2019 2:31 am

hahaha, dying of laughter I presume.
okay, I get the hint experiment and then see what happens
when the daggers come out from family members due to phucking up the network I will let you know how it goes......... maybe
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
 
Sob
Forum Guru
Forum Guru
Posts: 5026
Joined: Mon Apr 20, 2009 9:11 pm

Re: Dynamic DHCP & Recursive

Thu Oct 24, 2019 6:39 pm

I'm not saying that your questions are bad, in fact I'm sure I learned something new while thinking about some of them and trying to write flawless answer (to finally satisfy you, but it's not easy). But sometimes it feels like work... and I'm coming here to procrastinate. :)
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.
 
anav
Forum Guru
Forum Guru
Topic Author
Posts: 3185
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada

Re: Dynamic DHCP & Recursive

Thu Oct 24, 2019 7:12 pm

Thanks for the humour it helps make my day much more tolerable. Although I think you might have the "INATE" prefix wrong. Perhaps "ur" vice "procrast" ;-)
I come here when I feel overly adequate and need humbling.
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)
 
Sob
Forum Guru
Forum Guru
Posts: 5026
Joined: Mon Apr 20, 2009 9:11 pm

Re: Dynamic DHCP & Recursive

Thu Oct 24, 2019 10:43 pm

Slow down there, remember that I'm not native speaker, no advanced word play for me. I need it simple to keep up. Sob see router. Sob configure router. Router now safe. Hacker sad. Too bad. Well, not necessarily as simple as this. :)
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.
 
anav
Forum Guru
Forum Guru
Topic Author
Posts: 3185
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada

Re: Dynamic DHCP & Recursive  [SOLVED]

Fri Oct 25, 2019 5:45 pm

Bonjourno Sob, if you want a simpler view I have moved the intent of the thread to a simpler better focussed query here................
viewtopic.php?f=9&t=153296

Solved by Sob on the thread linked in this post. Honest I didnt get paid to say that!
I'd rather manage rats than software. Follow my advice at your own risk! (Sob & mkx forced me to write that!)

Who is online

Users browsing this forum: No registered users and 67 guests