Community discussions

MikroTik App
 
Cablenut9
Member
Member
Topic Author
Posts: 485
Joined: Fri Jan 08, 2021 5:30 am

Use OSPF with /32 subnets

Sat Jun 19, 2021 12:02 am

Is there a way to get OSPF working with Mikrotik routers that have /32 addresses? I'm interested in having a network where every router has only ONE unique address. If I used /24 or even /30 subnets, each router has multiple addresses I can route to. However, I only want one (1) address per router and the only way I can think of to do that is to use /32 subnets, which I can't seem to get working. The main things I did was assign a /32 address on each router with the corresponding entry in "network" (which is the same) and set the OSPF interface template to match /32 networks. The problem is, I can't get neighbors to show up or do anything at all. Is there a better way to do this? /30 would be the second-best option.
Serial question asker
 
mducharme
Trainer
Trainer
Posts: 1401
Joined: Tue Jul 19, 2016 6:45 pm

Re: Use OSPF with /32 subnets

Sat Jun 19, 2021 2:37 am

Is there a way to get OSPF working with Mikrotik routers that have /32 addresses?
Yes, it should be working. At least, these /32's work fine with OSPF over PPP tunnels. First, I would ask if you can ping the other router on its /32 address? You need for that to be working before OSPF will work. OSPF most likely has to be configured to use point-to-point network type in order to work with the /32's, rather than broadcast.
 
Cablenut9
Member
Member
Topic Author
Posts: 485
Joined: Fri Jan 08, 2021 5:30 am

Re: Use OSPF with /32 subnets

Sat Jun 19, 2021 2:49 am

I already selected the PtP network type, but it didn't work. I also set up loopback interfaces and added them to the interface templates. For some reason, I can't ping the other routers with /32 addresses even though all that connects them is a simple ethernet cable, and there's no firewall rules at all. However, I'm using PPP. Is there a way to make it work without PPP?
Serial question asker
 
mducharme
Trainer
Trainer
Posts: 1401
Joined: Tue Jul 19, 2016 6:45 pm

Re: Use OSPF with /32 subnets

Sat Jun 19, 2021 3:24 am

I already selected the PtP network type, but it didn't work. I also set up loopback interfaces and added them to the interface templates. For some reason, I can't ping the other routers with /32 addresses even though all that connects them is a simple ethernet cable, and there's no firewall rules at all. However, I'm using PPP. Is there a way to make it work without PPP?
You have to get pings working properly before you can expect OSPF to work. You might have the network address specified incorrectly. When you are using PTP /32 addressing, under ip->addresses, the network address has to be set to the IP on the other side of the /32. For instance if router1 ether1 is connected to router2 ether1:

Router1 ether1: IP address 10.30.0.1/32 network 10.30.0.2
Router2 ether1: IP address 10.30.0.2/32 network 10.30.0.1
Last edited by mducharme on Sat Jun 19, 2021 4:00 am, edited 1 time in total.
 
Cablenut9
Member
Member
Topic Author
Posts: 485
Joined: Fri Jan 08, 2021 5:30 am

Re: Use OSPF with /32 subnets

Sat Jun 19, 2021 3:25 am

I already selected the PtP network type, but it didn't work. I also set up loopback interfaces and added them to the interface templates. For some reason, I can't ping the other routers with /32 addresses even though all that connects them is a simple ethernet cable, and there's no firewall rules at all. However, I'm using PPP. Is there a way to make it work without PPP?
You have to get pings working properly before you can expect OSPF to work. You might have the network address specified incorrectly. When you are using PTP /32 addressing, under ip->addresses, the network address has to be set to the IP on the other side of the /32. For instance if router1 ether1 is connected to router2 ether1:

Router1 ether1: IP address 10.30.0.1/32 network 10.30.0.2
Router2 ether1: IP address 10.20.0.2/32 network 10.30.0.1
I'm going to try this, but why does it work this way? Also, is the R1's network supposed to be 10.20.0.2?
Serial question asker
 
mducharme
Trainer
Trainer
Posts: 1401
Joined: Tue Jul 19, 2016 6:45 pm

Re: Use OSPF with /32 subnets

Sat Jun 19, 2021 4:02 am

I'm going to try this, but why does it work this way? Also, is the R1's network supposed to be 10.20.0.2?
Sorry, it was a typo, I have fixed it above. The only reason the network setting is provided in the first place is because, in the case of /32's, you use the network setting to specify the IP of the other side. This assumes a single /32 to a single /32 in a PTP configuration. If you are doing PTMP instead, with one /32 to multiple /32's on the other sides, you should be able to get it working, but will likely need to duplicate the IP address configuration with a different network address for each spoke, or add routes on the "hub" side to explain how to get to the remaining "spokes".

The network setting AFAIK mostly saves you from needing to add static routes, as I believe i have gotten this working before without changing the network by manually adding static routes. It has been a long time since I used that method (adding static routes) though - I typically go the normal way (having duplicate address records with different network addresses for the spoke ends).

Who is online

Users browsing this forum: No registered users and 11 guests