Community discussions

MikroTik App
 
User avatar
t3rm
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Sat Aug 04, 2007 1:57 pm
Location: Bandung - WJ - Indonesia

Two interface using the same ip subnet

Mon Nov 12, 2007 11:24 am

Dear all,

I have subscription with two DSL Cable Modem serving the same ip subnet with DHCP.
They offered the ip address from 192.168.100.0/24 block.
The two line of DSL goes to ether1 and ether2. How do i handle this situation. Logically we cant setup two interfaces in one mikrotik for the same subnet.

Help, thanks
 
User avatar
winxp2000
Member Candidate
Member Candidate
Posts: 113
Joined: Mon Jan 30, 2006 8:57 pm
Location: China
Contact:

Re: Two interface using the same ip subnet

Mon Nov 12, 2007 11:54 am

why did you use the same subnet in the case?

As 2 Wan interface card, you can define 2 different IP address to them.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Two interface using the same ip subnet

Mon Nov 12, 2007 1:24 pm

Logically we cant setup two interfaces in one mikrotik for the same subnet.
you can use Proxy-ARP feature

but... could you please describe the situation with more details?
 
User avatar
t3rm
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Sat Aug 04, 2007 1:57 pm
Location: Bandung - WJ - Indonesia

Re: Two interface using the same ip subnet

Tue Nov 13, 2007 6:21 am

Chupaka,
please explain more details.

I have one weird client, h ehe he .. 8)
He subscribed with the ADSL Provider and after one subscriber line is not enough, he choose to take another one. So that means there are two ip addresses given by the ADSL Provider running at different interface.

I check the ip address, the ADSL Provider give in DHCP ip 192.168.100.12 and it goes for mikrotik ether1 and the other is 192.168.100.19 and goes to mikrotik ether2.
Both subnet are 255.255.255.0, connected to the same gateway ip address 192.168.100.1 (DSLAM) at ADSL Provider.

So in this case, i need to setup the two lines he subcribed and mix it under Mikrotik.

Thanks
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Two interface using the same ip subnet

Tue Nov 13, 2007 1:36 pm

you can use load balancing with interface routing (in v3)
 
User avatar
t3rm
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Sat Aug 04, 2007 1:57 pm
Location: Bandung - WJ - Indonesia

Re: Two interface using the same ip subnet

Wed Nov 14, 2007 7:05 am

Are you sure ? have you tried it ?

Two line of DSL i mentioned is the same provider with the same range of subnet. Connecting to one mikrotik router with different interface.
As far as i knew, the load balance you said only works with different network block, not the same one.

Please give a real example.
Thanks
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Two interface using the same ip subnet

Wed Nov 14, 2007 12:45 pm

in v2, you need two MT routers. in v3, there's interface routing, so you can mark packets with different routing mark and all'll be ok
 
User avatar
t3rm
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Sat Aug 04, 2007 1:57 pm
Location: Bandung - WJ - Indonesia

Re: Two interface using the same ip subnet

Thu Nov 15, 2007 12:42 pm

I already have my Mikrotik v3.0rc9
But i cant find the interface routing you mentioned.

Please share the information completely, or perhaps you need a payment for your consultancy ?
Thanks.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Two interface using the same ip subnet

Thu Nov 15, 2007 2:11 pm

in CLI

/ip route add gateway=<interfase name here>
 
User avatar
t3rm
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Sat Aug 04, 2007 1:57 pm
Location: Bandung - WJ - Indonesia

Re: Two interface using the same ip subnet

Thu Nov 15, 2007 8:19 pm

Janisk:

I dont think it might work.
How about we set this condition:

Mikrotik-PC
ether1: 192.168.0.1/24
ether2: 192.168.0.2/24

Monitoring-PC
ether1: 192.168.0.3/24

The two PC connected to same switch.
The question is, without routing, does Monitoring-PC able to reach ip 192.168.0.1 and 192.168.0.2 ?
How to do that

Thanks.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Two interface using the same ip subnet

Fri Nov 16, 2007 2:07 am

t3rm
hmmm... I cannot see connection between the topic problem and your last message...

you should mark some packets (from same connections, of course) as route1, and some others - as route2
in route1 routing table you should have route to 0.0.0.0/0 with gateway=ether1
in route2 routing table you should have route to 0.0.0.0/0 with gateway=ether2
that is all =)
 
User avatar
t3rm
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Sat Aug 04, 2007 1:57 pm
Location: Bandung - WJ - Indonesia

Re: Two interface using the same ip subnet

Fri Nov 16, 2007 7:38 pm

Chupaka:

It seemed you still didnt understand what i meant.
My last post, i hope it'll make you easier to imagine the thread we're talking about.

Please consider you have the same network 255.255.255.0 for that 3 nodes.
If those 3 under the same network, why you suggest to use routing ?
CMIIW,
routing didnt needed if the host is in the same network.

So how you manage it to make those three able to ping each other ?

Thank you.
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Two interface using the same ip subnet

Sat Nov 17, 2007 3:41 am

hmmm... i thought, you have standart adsl-lines, and you src-nat your network in provider's internal 192.168.100.x addresses =)

anyway, what kind of handling of situation do you need? :)
 
uol-vnet
newbie
Posts: 27
Joined: Fri May 19, 2006 8:38 pm
Location: Bangladesh

Re: Two interface using the same ip subnet

Sat Nov 17, 2007 11:41 pm

Dear t3rm ,


You can mark your traffic routing into two parts like ...

chain=prerouting action=mark-routing new-routing-mark=http passthrough=no src-port=1024-65535 dst-port=80 protocol=tc>

and.. other traffic like ..

chain=prerouting action=mark-routing new-routing-mark=other passthrough=no protocol=tcp routing-mark=!http

then you can route your traffic seperetly throuh two interface. I hope this will work becouse this is more like the prevoius stage of loadbalance.( Just dont need the balancing config
option when it is comming from the same subnet)

regards.
zubair
 
User avatar
t3rm
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Sat Aug 04, 2007 1:57 pm
Location: Bandung - WJ - Indonesia

Re: Two interface using the same ip subnet

Sun Nov 18, 2007 5:07 am

uol-vnet & chupaka:

Please answer the easiest details i gave on my last post.
Or perhaps the network mapping below will make it easier for both of you to understand:
MikrotikDUAL.jpg
That is the same situation when i subscribe with two line of ADSL from the same provider.
Ether1 and Ether2 under the same network.

Thanks.
You do not have the required permissions to view the files attached to this post.
 
uol-vnet
newbie
Posts: 27
Joined: Fri May 19, 2006 8:38 pm
Location: Bangladesh

Re: Two interface using the same ip subnet

Sun Nov 18, 2007 9:04 am

Dear t3rm ,

Check this configuration as per your requirement .


/ip firewall mangle
add chain=prerouting action=mark-routing new-routing-mark=http passthrough=no
src-port=1024-65535 dst-port=80 protocol=tcp

add chain=prerouting action=mark-routing new-routing-mark=other passthrough=n>
routing-mark=!http

ROUTE ::

/ip route add gateway=192.168.100.1

/ip route add routing-mark=http gateway=192.168.100.2

/ip route add routing-mark=other gateway=192.168.100.3


Now, in this situation all of your http trafiic will route trough IP 192.168.100.2(ether1) and all other traffic but HTTP will route through 192.168.100.3(ether2).

NB: You did not mention your local nat address so I asumed A different class than 192.168.100.x/24

Hope this will work for you.

Thanks
zubair
 
User avatar
t3rm
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Sat Aug 04, 2007 1:57 pm
Location: Bandung - WJ - Indonesia

Re: Two interface using the same ip subnet

Tue Nov 20, 2007 4:03 pm

Why would i need routing ?

From 192.168.100.2 or 192.168.100.3 to reach 192.168.100.1 doesnt need routing isnt it ?
Because those are in the same subnet.
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Re: Two interface using the same ip subnet

Tue Nov 20, 2007 7:15 pm

Basic networking principals okay!

If you're all on the same subnet then you're right, you don't need routing. So what are you asking ? If you don't want to route, then make a bridge. Or plug them all into the same switch and use a single network port with 2 ip addresses. You can use /32 as a subnet mask if you need.
 
uol-vnet
newbie
Posts: 27
Joined: Fri May 19, 2006 8:38 pm
Location: Bangladesh

Re: Two interface using the same ip subnet

Wed Nov 21, 2007 6:53 pm

Dear sir ,


If you do not route these packets through those TWO IPS then all the traffic will go to the default gateway directly and in that case only one connection will be active.if your provider manged the bandwidth on IP address then You can not get all the bandwidth from those two links .
In my opinion you have to divide your traffic into two part and force them to route on both connections.



Regards.
 
uol-vnet
newbie
Posts: 27
Joined: Fri May 19, 2006 8:38 pm
Location: Bangladesh

Re: Two interface using the same ip subnet

Wed Nov 21, 2007 7:14 pm

[quote]make a bridge. Or plug them all into the same switch and use a single network port with 2 ip addresses. You can use /32 as a subnet mask if you need.[/color][/quote]


Dear changeip

Are you sure that this bridge connection will get all the bandwidth even if the provider assign this bandwidth into two different queues based on those two ips ?

:?
 
User avatar
t3rm
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Sat Aug 04, 2007 1:57 pm
Location: Bandung - WJ - Indonesia

Re: Two interface using the same ip subnet

Fri Dec 28, 2007 8:14 pm

Thanks for all.

After all the explanation from above.
Finally i have a solution for this thread. Thats true, using interface routing.
Too bad, this is not worked under v2.9

:(
 
User avatar
NetworkPro
Forum Guru
Forum Guru
Posts: 1376
Joined: Mon Jan 05, 2009 6:23 pm
Location: bit.ly/the-qos
Contact:

Re: Two interface using the same ip subnet

Fri Jan 16, 2009 12:45 am

This is very interesting bridge setup. I have an idea for it - HTTP connections are netmapped and therefore sent to the different IP address. It's like this: 192.168.100.1 has a gateway 192.168.100.3 and sends everything to 192.168.100.3 bit MikroTik is in it's way and grabs all connections with dst-port=80 (and others...) and netmaps them to it's own IP address so they now come from the MikroTik IP address which in turn has a gateway of 192.168.100.2 and sends them there. Anyone can propose config commands?
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Two interface using the same ip subnet

Fri Jan 16, 2009 10:21 am

do not put two ip address from same subnet on separate interfaces of the same device unless, interfaces are bridged, no matter what equipment you have. Or else, your configuration will not work, if it seems to be working properly - it is not, you are just lucky and that can change. And most probably one day it will.
 
User avatar
NetworkPro
Forum Guru
Forum Guru
Posts: 1376
Joined: Mon Jan 05, 2009 6:23 pm
Location: bit.ly/the-qos
Contact:

Re: Two interface using the same ip subnet

Fri Jan 16, 2009 11:37 am

I agree. The correct connection would be 192.168.100.3 and 192.168.100.2 on two ports which are bridged and the MT IP is added to that Bridge interface, the client port is also bridged in same bridge. What config can we use to achieve what I described one post above? Some tricky bridge NATing or /bridge use ip firewall=yes and then using regular NAT ?
 
mnemonics
just joined
Posts: 1
Joined: Tue Jan 15, 2013 4:19 am

Re: Two interface using the same ip subnet

Tue Jan 15, 2013 4:25 am

I realize this is very old thread, however during my search for this topic I kept seeing this forum thread... so to finally answer the question.
/ip route
add gateway=10.1.101.1
add gateway=10.1.101.1%ether1 routing-mark=<mark #1>
add gateway=10.1.101.1%ether2 routing-mark=<mark #2>
The Key is the % mark between the gateway ip and the interface

SEE manual page::: http://wiki.mikrotik.com/wiki/Manual:Lo ... bnet_links

Regards,
 
User avatar
NetworkPro
Forum Guru
Forum Guru
Posts: 1376
Joined: Mon Jan 05, 2009 6:23 pm
Location: bit.ly/the-qos
Contact:

Re: Two interface using the same ip subnet

Tue Jan 15, 2013 11:07 am

Yep. Pretty awesome, nowadays.

Who is online

Users browsing this forum: coreywithne, CrZY23 and 22 guests