Community discussions

MikroTik App
 
cloun
just joined
Topic Author
Posts: 6
Joined: Sun Mar 27, 2011 4:56 am

routing subnets with overlapping address spaces

Sat Apr 02, 2011 12:34 am

Hi! I have two ip's in one subnet, and i need to forward traffic from clients of addresslist1 through $ether1 whith $addr1 and of addresslist2 through $ether2 whith $addr2.
It works when packets go from subnet to inet, but when responce is coming back packets go through wrong interface.
Example:
$localaddr1($iface1) -> $inetaddr($outiface)
$inetaddr($outiface) -> $localaddr1($IFACE2)
Sometimes ifaces are selected in a correct way but sometimes just on the contrary.

So what I try to do:
/ip firewall mangle add chain=prerouting action=mark-routing new-routing-mark=ether1 passthrough=no dst-address-list=allowether1
/ip firewall mangle add chain=prerouting action=mark-routing new-routing-mark=ether2 passthrough=no dst-address-list=allowether2

/ip route add dst-address=$subnet gateway=ether1 routing-mark=ether1 pref-src=$addr1
/ip route add dst-address=$subnet gateway=ether2 routing-mark=ether2 pref-src=$addr2

/ip route rule add routing-mark=ether1 action=lookup table=ether1
/ip route rule add routing-mark=ether2 action=lookup table=ether2
But this doesn't help. Can anybody help me?
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: routing subnets with overlapping address spaces

Mon Apr 04, 2011 11:07 pm

How about "/ip firewall nat"? How are you translating your private ips to the public network?
 
cloun
just joined
Topic Author
Posts: 6
Joined: Sun Mar 27, 2011 4:56 am

Re: routing subnets with overlapping address spaces

Wed Apr 06, 2011 7:30 pm

/ip firewall nat print
;;; masquerade hotspot network
chain=srcnat action=masquerade src-address=10.1.1.0/24
only
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

Re: routing subnets with overlapping address spaces

Wed Apr 06, 2011 8:32 pm

I thought you had two customers. Are they both sharing 10.1.1.0/24?

I do not understand your setup. Can you be more specific about your ip and subnet assignments for ether1 and ether2? If the WAN ips are in the same subnet, why not assign them both to one interface?
 
cloun
just joined
Topic Author
Posts: 6
Joined: Sun Mar 27, 2011 4:56 am

Re: routing subnets with overlapping address spaces

Thu Apr 07, 2011 2:31 am

So I’ll try to explain you what I need to do and what for. I’ve got a hostile switch that monitors our subnet. I'm providing the internet illegally. So I’m trying to transport traffic bypassing that switch. Three up-links go from the switch to 10.1.1.1/24 subnet. I have three interfaces with its own ip address each and they are connected to br1, br2, br3(switches) the way you can see in the picture attached. You’ll probably offer me to use one ip for a bridge of these three interfaces. But it doesn’t work. Packets just go the longer way through the evil switch. Now I’m trying to make my mikrotik forward packets the way shown in the picture.
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: No registered users and 37 guests