Community discussions

MikroTik App
 
User avatar
pekr
Member Candidate
Member Candidate
Topic Author
Posts: 169
Joined: Tue Feb 22, 2005 9:05 pm
Location: Czech Republic
Contact:

IP addresses in the same subnet across multiple interfaces?

Mon Nov 22, 2021 9:00 pm

Hi,

I have tried to google the topic, but I can't somehow decide, if having two IP addresses from the same subnet on two different physical interfaces, is a problem or not.

The situation is quite simple - imagine PC / notebook connected by both the ethernet cable and wi-fi to one MT router via a switch, being offered IP addresses from the same subnet. E.g. eth: 10.0.1.1/24 and wi-fi: 10.0.1.2/24.

I just wonder, if it could posses some problems in communication? Or even some loops? I have found we've got such setup on multiple locations. I reconfigured one of them to use the VLANs to separate the traffic, but was told by one of the suppliers, that there should not be any problem to such setup.

So - is that just me having wrong assumption of eventual problems? E.g. some notebook producers allow you tu disable wi-fi, if eth is connected, via a bios setting and I think there might be a good reason for that ....
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11593
Joined: Thu Mar 03, 2016 10:23 pm

Re: IP addresses in the same subnet across multiple interfaces?

Mon Nov 22, 2021 9:32 pm

If none of LAN infrastructure devices "play smart", then the most likely outcome would be asymmetrical packet flow: if some connection uses laptop's wireless IP address (ingress will flow through wireless) while routing priorities (e.g. due to lower metric) will use ethernet for egress.

If addresses for different interfaces are not in same subnet, then connections might break due to reasons explained in previous paragraph, only in this case some router/firewall might discard packets with "alien" src-address.

Which means it's the matter of sanity not to use both wired and wireless interface at the same tine ... unless one knows better.
 
spynappels
Member Candidate
Member Candidate
Posts: 106
Joined: Mon Oct 25, 2021 12:32 pm
Location: Northern Ireland
Contact:

Re: IP addresses in the same subnet across multiple interfaces?

Mon Nov 22, 2021 9:35 pm

If the ethernet interface and the wireless interface on the router are on the same bridge, then it may not be a big problem, the laptop would just select which interface the traffic would go out of.

If the wlan1 and etherx were on separate interfaces that require routing, you'd have problems, not least of which the DHCP config handing out those IP addresses on different subnets would be wrong.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19323
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: IP addresses in the same subnet across multiple interfaces?

Mon Nov 22, 2021 10:45 pm

Thats up to the individual running the laptop. Connectivity is required and provided.
Two separate mac addresses two connections, only one will be used at a time.
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: IP addresses in the same subnet across multiple interfaces?

Mon Nov 22, 2021 10:51 pm

No need to be afraid of any loops, as the two interfaces are not bridged on the Windows PC. The only thing I can imagine to happen could be that the PC would respond to the ARP request for one of the addresses also with the MAC address of the "wrong" interface, but /tool sniffer on the Mikrotik or Wireshark on the PC should quickly tell this, and it may not cause a problem either if the PC accepts IP packets even if they come in via a "wrong" interface, which it should. So the biggest issue should be that you would be unable to predict which of the two addresses the Windows will choose for outgoing traffic.

The disabling of WiFi if Ethernet port is connected has more to do with saving power, WiFi bandwidth, and IP address pool if wired connection is available. And it may become a PITA if you need to use each interface in another network, e.g. one of them for internet connection and access via TeamViewer/Anydesk/Remote Desktop and the other one to connect to a device in LAN, and you have to reboot to disable the feature in BIOS.
 
User avatar
pekr
Member Candidate
Member Candidate
Topic Author
Posts: 169
Joined: Tue Feb 22, 2005 9:05 pm
Location: Czech Republic
Contact:

Re: IP addresses in the same subnet across multiple interfaces?

Tue Nov 23, 2021 9:10 am

If the wlan1 and etherx were on separate interfaces that require routing, you'd have problems, not least of which the DHCP config handing out those IP addresses on different subnets would be wrong.

The router is CCR1009, no switch, no bridge there. The rest of the LAN, including wi-fi APs, come from the separate switch, connected to the eth2 port of the MT router, via just one cable. No VLAN there.

So basically - MT gives DHCP addresses to whatever is on the switch, which means - when you connect your notebook by both the eth and wi-fi, you obtain 2 addresses from identical subnet, assigned to two different physical interfaces.

And that's where I wondered, if it's correct, or not .....
 
spynappels
Member Candidate
Member Candidate
Posts: 106
Joined: Mon Oct 25, 2021 12:32 pm
Location: Northern Ireland
Contact:

Re: IP addresses in the same subnet across multiple interfaces?  [SOLVED]

Tue Nov 23, 2021 9:26 am

The router is CCR1009, no switch, no bridge there. The rest of the LAN, including wi-fi APs, come from the separate switch, connected to the eth2 port of the MT router, via just one cable. No VLAN there.
Ok, I should have more correctly said that the AP/WiFi connection and the wired connection were in the same broadcast domain, which having them on the same bridge in the router would also accomplish.

As others have said, the OS should be smart enough to use one or the other, and as long as they are not bonded on the laptop (not normally done) then you should not have to worry about loops.
 
emunt6
Member Candidate
Member Candidate
Posts: 103
Joined: Fri Feb 02, 2018 7:00 pm

Re: IP addresses in the same subnet across multiple interfaces?

Tue Nov 23, 2021 11:07 pm

Hi,

I have tried to google the topic, but I can't somehow decide, if having two IP addresses from the same subnet on two different physical interfaces, is a problem or not.

The situation is quite simple - imagine PC / notebook connected by both the ethernet cable and wi-fi to one MT router via a switch, being offered IP addresses from the same subnet. E.g. eth: 10.0.1.1/24 and wi-fi: 10.0.1.2/24.

I just wonder, if it could posses some problems in communication? Or even some loops? I have found we've got such setup on multiple locations. I reconfigured one of them to use the VLANs to separate the traffic, but was told by one of the suppliers, that there should not be any problem to such setup.

So - is that just me having wrong assumption of eventual problems? E.g. some notebook producers allow you tu disable wi-fi, if eth is connected, via a bios setting and I think there might be a good reason for that ....

It is possible, on the WIFI-AP just need to use "bridge to vlan" or "bridge to LAN" - then "the WIFI clients will look like as a wired LAN clients".

The other question is also possible but not with mikrotik router - that technology is called VRF ( virtual routing and forwarding ) - because mikrotik's VRF implementation is not the "true VRF" they using the "routing mark" hacks. The VRF is like a L3 domain, when you assign an interface to specific VRF - domain, it has its unique RIB and FIB, ( route table ), when you want exchange traffic between the VRF-Domains thats called "VRF route leaking" in this case you need to use some dynamic-routing protocol to exchange the route-tables between the VRF-Domains, that protocol is MP-BGP ( Multiprotocol - BGP ).
When you using VRF without BGP / MP-BGP - thats called "VRF-lite" in cisco terminology.
Vendors: Cisco, Juniper, HPE Comware

I introduced the basics, now you can use google for the rest.
 
User avatar
pekr
Member Candidate
Member Candidate
Topic Author
Posts: 169
Joined: Tue Feb 22, 2005 9:05 pm
Location: Czech Republic
Contact:

Re: IP addresses in the same subnet across multiple interfaces?

Wed Nov 24, 2021 1:47 pm

I am sorry but I am not that skilled to have an experience with VRF, etc. As for bridging the wi-fi to LAN, I am not sure. It is an Aruba virtual controller + several APs setup, so don't want to mess with that.

Maybe the easiest it is to split the network using VLANs, settting-up a DHCP for a wi-fi part, so that I can distinguish the traffic. But hey - thanks anyway for that VRF stuff - there's always something new to learn ...

Who is online

Users browsing this forum: litogorospe and 52 guests