Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-17-2014, 10:44 AM
|
#1
|
LQ Newbie
Registered: Sep 2011
Posts: 29
Rep: 
|
Having multiple NICs with same IP/subnet
Dear Community
Does anyone has an idea how this issue could be solved:
wlan0: IP 10.0.0.2, Server IP 10.0.0.1
wlan1: IP 10.0.0.3, Server IP 10.0.0.1
wlan2: IP 10.0.0.4, Server IP 10.0.0.1
Is there any way I can connect to all three servers (10.0.0.1) simultaneously over TCPIP without changing the subnet or ip?
My thought was to create some kind of virtual IPs and specify routing options based on specific interface.
For example
virtual IP 11.0.0.1 -> wlan0:10.0.0.1
virtual IP 12.0.0.1 -> wlan1:10.0.0.1
virtual IP 13.0.0.1 -> wlan2:10.0.0.1
Is this possible or is there any other soloutions that lets me connect to the server 10.0.0.1 in each network (wlan0/wlan1/wlan2). Connection needs to be established only in one direction towards the server and the networks do not need to be routed among themselves.
any help would be appreciated
Kind Regards
Flowsen
Linux version 2.6.32-5-amd64 (Debian 2.6.32-48squeeze1) (dannf@debian.org) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Mon Feb 25 00:26:11 UTC 2013
|
|
|
02-17-2014, 10:56 AM
|
#2
|
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,559
|
Do you have a server with three NICS that you want to access as 10.0.0.1 or do you have a workstation with three NICS that you want to use to access Server 10.0.0.1, or do you have three NICS in a server and want to have three separate networks each with the same subnet?
You could look at NIC Bonding, however if you're looking to combine three NICS on the same IP to get 3XSpeed then your network switch has to also be capable or doing this.
|
|
|
02-17-2014, 11:00 AM
|
#3
|
LQ Newbie
Registered: Sep 2011
Posts: 29
Original Poster
Rep: 
|
I have a client that has three NICs.
The three servers on each NIC all have the IP 10.0.0.1. These are completely isolated networks and even three different servers.
The only thing I need to achive is to connect to all these server from my client at the same time.
|
|
|
02-17-2014, 11:18 AM
|
#4
|
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,559
|
Ok, so your network topology is like this:
Code:
+-----------------------------+
| Client |
| NICA NICB NICC |
+----+----------+----------+--+
| | |
| | |
+----+---+ +----+---+ +----+---+
|SVR A | |SVR B | |SVR C |
|10.0.0.1| |10.0.0.1| |10.0.0.1|
+----+---+ +----+---+ +----+---+
That's a good one.
Yes, looks like you'll have to set up three hosts definitions and route the packets accordingly, are you also cursed with the same IP address on each interface on the client side?
|
|
|
02-17-2014, 11:22 AM
|
#5
|
LQ Newbie
Registered: Sep 2011
Posts: 29
Original Poster
Rep: 
|
yes, thats exactly the network topology.
Luckily I can have DHCP turned off and NICA, NICB, NICC can have different IPs.
So there should be no IP conflict.
What do you propose for routing? iptables with ipv4 forwarding?
PS:
Using curl and specifing the interface works well. I am able to connect each server. Anyone has an idea how to specify virtual IPs and route them to the specific interfaces?
Last edited by Flowsen; 02-17-2014 at 12:02 PM.
|
|
|
02-17-2014, 02:53 PM
|
#6
|
Moderator
Registered: Mar 2008
Posts: 22,358
|
You could create a virtual ip on each computer outside of the original subnet.
192.168.x.x x+1 x+2 for example and then use the 10.0.0.1 server to bridge those. Seems rather odd.
|
|
|
02-17-2014, 03:13 PM
|
#7
|
Senior Member
Registered: Jan 2012
Distribution: Slackware
Posts: 3,348
Rep: 
|
Quote:
Originally Posted by Flowsen
Using curl and specifing the interface works well.
|
It works because the application (curl) allows you to specify which interface to use. Most applications have no such setting/parameter.
By assigning different addresses in the 10.0.0.0/24 IP network to three different interfaces connected to different, physical networks, you're telling the PC: - "The same network, 10.0.0.0/24, exists in three different places" (which is an invalid configuration), and
- "The IP address 10.0.0.1 may refer to any of three different hosts, depending on which interface you use" (which is also not a valid configuration)
The only network which may appear in multiple places simultaneously, is the link-local network (169.254.0.0/16). You should not try to do something similar with a different IP network.
Quote:
Originally Posted by Flowsen
Anyone has an idea how to specify virtual IPs and route them to the specific interfaces?
|
I'd recommend assigning secondary addresses in different networks to each of these servers. You can then configure each wlan interface with another address in that same network.
Last edited by Ser Olmy; 02-17-2014 at 03:14 PM.
|
|
|
02-18-2014, 12:53 AM
|
#8
|
Member
Registered: Jan 2005
Location: Lviv, Ukraine
Distribution: Something self-made
Posts: 69
Rep:
|
To make your netowrk configuration simplier i'd suggest following:
1. Create 3 virtual machines with two network interfaces each
2. Each first virtual interface bridge to corresponding NIC at the side of host and assign some address inside the VM (each can have 10.0.0.2 - now it`s three different machines)
3. Assign each second virtual interface a pair of addresses
- 192.168.0.1/30 at the host side and 192.168.0.2/30 at VM side in VM_A
- 192.168.0.5/30 at the host side and 192.168.0.6/30 at VM side in VM_B
- 192.168.0.9/30 at the host side and 192.168.0.10/30 at VM side in VM_C
4. Inside each VM create iptables rule to DNAT incoming connections to 192.168.0.2 (or 6 or 10) to 10.0.0.1
For each server you'll get something like this
Code:
+------------------------------
|
| VNICA2
| |
| +----+----+
| | VM_A |
| +----+----+
| |
| bridge VNICA1 and NICA
| |
| NICA
+------------+-----------------
|
+----+----+
| SRV_A |
+---------+
Now server SRV_A will be accessible as 192.168.0.2, SRV_B - as 192.168.0.6 and SRV_C - as 192.168.0.10 - no misunderstandings, no collisions
Virtual machines can be created using UML (UserMode Linux) with minimalistic kernel and minimalistic busybox (all you need is shell, iproute2, iptables). It will use only few megabytes on your drive.
|
|
|
02-19-2014, 08:15 AM
|
#9
|
LQ Newbie
Registered: Nov 2011
Location: Ingleside, Texas
Distribution: openSUSE 12.1
Posts: 14
Rep: 
|
Say What?!
What you do is against the laws of our Computer God. First off, The same subnet is OK. but, the ip addressing is wacked.The last 3 numbers in an ip address xxx.xxx.xxx.(xxx), are reserved for the actual computer going online in the network. NO TWO computers can have the same ip address. How would the server know to only send data to one of the computers. You will get an onscreen error with two computers using the same ip address on the same net. What you can do is change the third set of numbers xxx.xxx.(xxx).xxx for each server. Example 192.168.0.1, 192.168.1.1, and 192.168.2.1. This would keep them in the same subnet with different ip addressing. This should give you about 252-3 computer connections per local net.
Master Rod
|
|
|
02-19-2014, 08:38 AM
|
#10
|
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,559
|
Quote:
Originally Posted by rrdonovan
The last 3 numbers in an ip address xxx.xxx.xxx.(xxx), are reserved for the actual computer going online in the network.
|
Only assuming a 255.255.255.0 hostmask. The rest of your post also contains misunderstandings about how Ethernet works.
At no point does the OP state that he wants to bridge the three separate networks, so what the OP is attempting to do (while I agree is "odd") should be achievable by assigning each of the remote servers an internal IP on his client machine and using NAT and routing to correctly route packets over the outgoing interfaces.
|
|
|
02-19-2014, 09:10 AM
|
#11
|
LQ Newbie
Registered: Sep 2011
Posts: 29
Original Poster
Rep: 
|
Quote:
Now server SRV_A will be accessible as 192.168.0.2, SRV_B - as 192.168.0.6 and SRV_C - as 192.168.0.10 - no misunderstandings, no collisions
Virtual machines can be created using UML (UserMode Linux) with minimalistic kernel and minimalistic busybox (all you need is shell, iproute2, iptables). It will use only few megabytes on your drive.
|
That's exactly what I intended to do. But I thought it would be possible to just create virtual IPs instead of creating whole virtual machines. This is unfortunately not possible because its an embedded device with strictly bordered resources.
Quote:
What you do is against the laws of our Computer God. First off, The same subnet is OK. but, the ip addressing is wacked.The last 3 numbers in an ip address xxx.xxx.xxx.(xxx), are reserved for the actual computer going online in the network. NO TWO computers can have the same ip address.
|
Well as already mentioned the computers with the same IPs are on isolated non bridged networks. They wont conflict as little as average 192.168.0.1 homeserver running in your neighborhood. The inital question was how to tell the client with three NICs to talk to the servers with the same IP but in different networks.
As already mentioned PING, CURL etc. allow to bind to an interface, but not all application are able to do so.
|
|
|
02-19-2014, 09:19 AM
|
#12
|
Member
Registered: Jan 2005
Location: Lviv, Ukraine
Distribution: Something self-made
Posts: 69
Rep:
|
Quote:
Originally Posted by Flowsen
That's exactly what I intended to do. But I thought it would be possible to just create virtual IPs instead of creating whole virtual machines. This is unfortunately not possible because its an embedded device with strictly bordered resources.
|
Probably it can be done by adding 3 different ip addresses to some other interface, marking connections accordingly to these addresses and using connmark-based routing rules, combined with DNAT, but it`ll be VERY unpredictable configuration.
|
|
|
All times are GMT -5. The time now is 07:04 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|