Community discussions

MikroTik App
 
User avatar
richinuk
Member Candidate
Member Candidate
Topic Author
Posts: 149
Joined: Tue Jan 22, 2008 9:30 pm

Default routing with a /32 mask

Mon Aug 20, 2012 2:05 am

Hi guys,

I have a MT router in a hosting datacentre, and by default they allocate me a /32 address (long story, but this is how it is!). Let's assume my MT IP is 20.1.1.1/32 and their next hop IP is 40.2.2.254 with a MAC of 00:11:22:33:44:55.

Their standard configuration for a redhat box is as follows (they don't natively support Mikrotik, so I have to improvise):
/etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
IPV6INIT=no
PEERDNS=yes
TYPE=Ethernet
NETMASK=255.255.255.255
IPADDR=20.1.1.1
GATEWAY=40.2.2.254
ARP=yes
HWADDR=<whatever>

/etc/sysconfig/network-scripts/route-eth0
40.2.2.254 dev eth0
default via 40.2.2.254 dev eth0
... which basically says - proxy arp for the next hop 40.2.2.254 via eth0, then add a default route via that host/mac.

So I configured what I believe to be the equivalent in MT:
/ip route add dst-address=40.2.2.254 gateway=ether1
/ip route add dst-address=0.0.0.0/0 gateway=40.2.2.254
But it doesn't work. The default route says 40.2.2.254 is unreachable, even though it is:
[admin@MT-FR-01] /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
 0   S  0.0.0.0/0                          40.2.2.254               1
 1 ADC  20.1.1.1/32        20.1.1.1        ether1                   0
 2 A S  40.2.2.254/32                      ether1                   1
[admin@MT-FR-01] /ip route> print detail
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
 0   S  dst-address=0.0.0.0/0 gateway=40.2.2.254 gateway-status=40.2.2.254 unreachable distance=1 scope=30 target-scope=10

 1 ADC  dst-address=20.1.1.1/32 pref-src=20.1.1.1 gateway=ether1 gateway-status=ether1 reachable distance=0 scope=10

 2 A S  dst-address=40.2.2.254/32 gateway=ether1 gateway-status=ether1 reachable distance=1 scope=30 target-scope=10
[admin@MT-FR-01] /ip route> /ping 40.2.2.254
HOST                                     SIZE TTL TIME  STATUS
40.2.2.254                                 56 255 44ms
40.2.2.254                                 56 255 1ms
40.2.2.254                                 56 255 2ms
    sent=3 received=3 packet-loss=0% min-rtt=1ms avg-rtt=15ms max-rtt=44ms
Now, if I just add the default route via gateway=ether1, it works. But, as expected, we use proxy-arp for every IP address. This isn't good - fills up the arp table, and the hosting provider doesn't like it also. Below arp output is after adding the gateway=ether1 and using proxy-arp:
[admin@MT-FR-01] /ip route> /ip arp print
Flags: X - disabled, I - invalid, H - DHCP, D - dynamic
 #   ADDRESS         MAC-ADDRESS       INTERFACE
 0 D 129.82.138.38   00:11:22:33:44:55 ether1
 1 D 78.159.107.102  00:11:22:33:44:55 ether1
 2 D 2.51.47.253     00:11:22:33:44:55 ether1
 3 D 40.2.2.254      00:11:22:33:44:55 ether1
 4 D 194.164.127.4   00:11:22:33:44:55 ether1
Anyone got any thoughts on how I configure a next hop IP that is not on the directly connected subnet? I also tried creating a static ARP entry incase that helped, but it didn't.

Cheers,
Rich
 
burkni
newbie
Posts: 29
Joined: Tue Mar 29, 2011 1:55 pm

Re: Default routing with a /32 mask

Mon Aug 20, 2012 4:19 pm

If your IP is 20.1.1.1/32 then the other end should be 20.1.1.2/32 so that should be your GW or next hop don't you think? That's how it's setup at my connection, the other side of the 2 IP subnet is the GW.
 
User avatar
richinuk
Member Candidate
Member Candidate
Topic Author
Posts: 149
Joined: Tue Jan 22, 2008 9:30 pm

Re: Default routing with a /32 mask

Mon Aug 20, 2012 7:49 pm

Hi Burkni. If the netmask was a /30 or shorter, then yes. But in this case, we have a /32, which is the crux of the problem.
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: Default routing with a /32 mask

Tue Aug 21, 2012 3:41 am

This should work:
/ip address add address=20.1.1.1/32 interface=ether1 network=40.2.2.254
/ip route add gateway=40.2.2.254
 
User avatar
richinuk
Member Candidate
Member Candidate
Topic Author
Posts: 149
Joined: Tue Jan 22, 2008 9:30 pm

Re: Default routing with a /32 mask

Wed Aug 22, 2012 4:23 pm

This should work:
/ip address add address=20.1.1.1/32 interface=ether1 network=40.2.2.254
/ip route add gateway=40.2.2.254
Cool. That works. Never thought of doing it that way :)

Thanks Sob.

Regards,
Richard