Community discussions

MikroTik App
 
ibm
Member
Member
Topic Author
Posts: 306
Joined: Mon May 12, 2014 5:16 pm

Routing with 2 gateway in a /29

Thu Jan 29, 2015 2:32 pm

Hi
if I've the following net and I would know how to make my router act as gateway.

ISP gave me
SUBNET: 10.0.155.168/29 (in reality it's public but I changed the first 2 byte for privacy reasons)
GATEWAY: 10.0.155.174

RB1 (mine)
BRIDGE ADDRESS: 10.0.155.169/29
ROUTE DST 0.0.0.0/0 GW 10.0.155.174

RB2 (mine and attached to the RB1)
BRIDGE ADDRESS 10.0.155.170/29
ROUTE DST 0.0.0.0/0 GW 10.0.155.169

I would that the default gateway have to be the RB1 but with this config does not work, why?
 
InoX
Forum Guru
Forum Guru
Posts: 1966
Joined: Tue Jan 09, 2007 6:44 pm

Re: Routing with 2 gateway in a /29

Fri Jan 30, 2015 1:10 am

I don't think is possible that thier gateway can be in your ip class.

SUBNET: 10.0.155.168/29
GATEWAY: 10.0.155.174
 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 829
Joined: Tue Aug 03, 2004 9:01 am

Re: Routing with 2 gateway in a /29

Fri Jan 30, 2015 6:00 am

Bro, do you even route? :D

I don't think that doing this makes a whole lot of sense, but that should work *as long as* you are bridging RB2's port on RB1 to the WAN port on RB1. In all likelihood, though, RB1 will send RB2 an ICMP redirect message because it knows that having RB2 send stuff directly to your ISP's gateway is a more direct path.

-- Nathan
 
ibm
Member
Member
Topic Author
Posts: 306
Joined: Mon May 12, 2014 5:16 pm

Re: Routing with 2 gateway in a /29

Fri Jan 30, 2015 8:59 am

For Inox: the host 174 is in the subnet, you can check in ipcalc.
For Nathan: I usually do Nat so I have only the default route.
Like you said rb2 receive the redirect icmp.
The purpose to have rb1 as gateway is the possibility to limit traffic of the rb1 with queue on rb1.
 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 829
Joined: Tue Aug 03, 2004 9:01 am

Re: Routing with 2 gateway in a /29

Fri Jan 30, 2015 9:03 am

The purpose to have rb1 as gateway is the possibility to limit traffic of the rb1 with queue on rb1.
That likely won't work too well, since because you have to bridge the two ports together, the WAN and LAN will both be on the same interface (bridge). Super-messy.

Go back to your ISP and ask them to give you a /30 for the WAN, and then route a /29 to you. Problem solved.

-- Nathan
 
ibm
Member
Member
Topic Author
Posts: 306
Joined: Mon May 12, 2014 5:16 pm

Re: Routing with 2 gateway in a /29

Fri Jan 30, 2015 10:10 am

In a situation like this the GW for RB1 is .169 and the GW for RB2 is .173 right?
But how can I route the second /30 if the address on eth1 is only one /30?
Maybe are needed vlans?

Image
 
User avatar
NathanA
Forum Veteran
Forum Veteran
Posts: 829
Joined: Tue Aug 03, 2004 9:01 am

Re: Routing with 2 gateway in a /29

Fri Jan 30, 2015 10:49 am

I am not sure why you are talking about a "second" /30. What I mean is ask for 2 subnets from ISP: one /30 for the WAN, and one /29 pointed at your WAN address on their router.

For example, pretend they give you 10.0.155.164/30 and 10.0.155.168/29. The /30 would be for the WAN, with .165 on their router and .166 on yours. Then they would route 10.0.155.168/29 to 10.0.155.166.

In RouterOS speak, it would look like this on their router:
/ip address add address=10.0.155.165/30 interface=ibm
/ip route add dst-address=10.0.155.168/29 gateway=10.0.155.166
...and then on your RB1, you would do this:
/ip address add address=10.0.155.166/30 interface=WAN
/ip address add address=10.0.155.169/29 interface=RB2
/ip route add dst-address=0.0.0.0/0 gateway=10.0.155.165
...and finally, on RB2, you would do this:
/ip address add address=10.0.155.170/29 interface=RB1
/ip route add dst-address=0.0.0.0/0 gateway=10.0.155.169
Now, if you are talking about "second" /30 because you are thinking about splitting your /29 into 2 /30s, you can do this, but because your provider is treating it as a /29 on their side, you will have to treat one half of the /29 (the one with their gateway address in it) still as a /29, create an address in the other half of the /29 as a /30, and enable proxy-arp on your WAN interface. On RB1:
/ip address add address=10.0.155.173/29 interface=WAN
/ip address add address=10.0.155.169/30 interface=RB2
/ip route add dst-address=0.0.0.0/0 gateway=10.0.155.174
/interface ethernet set WAN arp=proxy-arp
...and on RB2:
/ip address add address=10.0.155.170/30 interface=RB1
/ip route add dst-address=0.0.0.0/0 gateway=10.0.155.169
...but this is a very wasteful and inefficient use of the IPs in such a small subnet. The only remaining usable IP address after this will be 10.0.155.172, and only if you bridge it directly to the ISP and use .174 as your gateway for that device.

If there will not be any other devices except for RB1 and RB2 (or of there are others, you will use NAT for them), and your ISP won't give you a /29 and a /30, you could try to ask them to split the /29 into 2 /30s on their side and use one as the WAN subnet and route the other /30 to you in the same way I described for the /29. You would set that up exactly the same way that I described in the example with the routed /29.

You may want to go pick up a good book on the subject of networking, IP routing, and ethernet. :)

-- Nathan
 
ibm
Member
Member
Topic Author
Posts: 306
Joined: Mon May 12, 2014 5:16 pm

Re: Routing with 2 gateway in a /29

Fri Jan 30, 2015 2:28 pm

Thanks a lot, now it's clear :)

Who is online

Users browsing this forum: GoogleOther [Bot], johnson73 and 33 guests