Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20
I know this is widely talked about over the internet but I cannot find a black and white solution especially given I am no linux guru. Problem: I have two ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2011
    Posts
    5

    Talking Multiple NIC with a single Subnet


    I know this is widely talked about over the internet but I cannot find a black and white solution especially given I am no linux guru.

    Problem: I have two seperate networks both using the same subnetmask which is a must and I would like to have a single redhat enterprise box visible from both networks at the same time. I have configured two network interfaces and have the below scheme

    eth0 192.168.1.3 subnet 255.255.255.0
    eth1 192.168.1.4 subnet 255.255.255.0


    The problem is that I can only ping thing on eth0's network yet both networks look fine when doing ifconfig. I have read reviews of this problem and it seems to be a linux issue and the solution varies from creating routing tables and messing with ARP etc but none give me enough details to implement these myself. The NIC's are currently tied to the two motherboard ports but can just as easily be transfered to seperate cards but I believe the issue is more a linux only allowing a single port to be brought up on the subnet mask.

    The Mac address for each one looks different and both ports are enabled and on the machine I can ping both just not out of eth1.

    I know a enough about redhat to navigate round, setup networks and knock up scripts etc but not enough about the networking + ARP + Routing tables to do anything clever myself, so an idiots guide would be massively appreciated!!

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    You say you must use the same subnetmask for both networks. Can they be different (non-routable) networks, though? For example, what I would do is, configure your box with 2 NICs like this:
    Code:
    ip addr add 192.168.1.3/24 dev eth0
    ip addr add 192.168.0.4/24 dev eth1
    Then on the RHEL box, just add a second ip address on the 2nd network to the default interface (I guess eth0):
    Code:
    ip addr add 192.168.0.X/24 dev eth0 label eth0:0
    Of course, if the RHEL box has a 2nd NIC, you can just assign this 2nd ip address to that instead.

    But maybe you cannot add ip addresses to the RHEL box, or you are not allowed to add other networks...just a thought.

  3. #3
    Just Joined!
    Join Date
    Jul 2011
    Posts
    5
    Not sure if I explained my problem clearly. I have two networks which are completly identical sharing the same number of computers with the same IP's and subnetmask. What I absolutley do not want to do is connect these networks together in anyway as they will have a catastrophic IP clash with one another.

    What I want to do is add a single RHEL box that can see both networks, so what I did was configure a RHEL box with two NIC with the same subnet mask

    255.255.255.0
    and gave each NIC and unique IP

    eth0 192.168.1.3
    eth1 192.168.1.4
    and attached each NIC to the two networks but on reboot only the first NIC that is activated works, the second is made active but I cannot ping anything on the second network. After googling this problem it seems linux does not like two NIC's sharing the same subnet mask with messing around, but I do not know how to configure this to work.

  4. $spacer_open
    $spacer_close
  5. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,410
    Bond them, then define aliases on the bond device.
    Network Card Bonding On CentOS | HowtoForge - Linux Howtos and Tutorials
    You must always face the curtain with a bow.

  6. #5
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,410
    Please pay attention to the notes on that mini howto:
    Some of the nodes require switch features and/or switch configuration
    You must always face the curtain with a bow.

  7. #6
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,410
    Ah sorry.
    I missed the part about "two networks, but with the same IPs" (not enough coffee today...)

    Probably you need to rework the networks.

    If there is machine A with IP 192.168.1.100 in the first network
    and also a machine B with IP 192.168.1.100 in the second network,
    then afaik there is no way to know which interface to take.
    You must always face the curtain with a bow.

  8. #7
    Just Joined!
    Join Date
    Jul 2011
    Posts
    5
    lol no worries i just read that page about bonding I thought that might not be the answer!

  9. #8
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Well, I don't know of a way to have 2 NICs in the same network/subnet on the same machine. How about a VM, though? Could you install a VM on the RHEL box, and have the box's 2nd NIC be the VM's network device and put this 2nd ip address on that one? They are two separate OSs (logically) so maybe that would work...

  10. #9
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,410
    What is stopping you from pushing all the IPs in -say- the second network to 192.168.2.0/24 ?
    You must always face the curtain with a bow.

  11. #10
    Just Joined!
    Join Date
    Jul 2011
    Posts
    5
    Really what this RHEL box's role is supposed to be is a file share so it's less important for that to be able to look out on both networks but I was hoping to be able to have each network able to ftp files to this single RHEL box and deposite files on to it.

    Changing the IP scheme on the networks is a nogo really they need to be identical so that if a box dies on one network and quick switch of the cable allows its clone to be switched over in its place.

    A VM would seperate the files on the box so again I couldnt use that.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •