WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Multi NIC's different subnets set up  (Read 3476 times)

Offline sergle

  • Newbie
  • *
  • Posts: 5
Multi NIC's different subnets set up
« on: November 26, 2010, 03:16:52 PM »
Hello,

I am trying to set up Microcore64 to run on an industrial PC with multiples Ethernet interfaces.

There are four Ethernet NIC's chips:

Here is the NIC's set up:

eth0: not used
eth1: 192.168.0.10 netmask 255.255.255.0
eth2: 192.168.1.100 netmask 255.255.255.0
eth3: 192.168.2.100 netmask 255.255.255.0

I have a script that does the following which is called from bootlocal.sh

Code: [Select]
ifconfig eth1 192.168.0.10 netmask 255.255.255.0
ifconfig eth2 192.168.1.100 netmask 255.255.255.0
ifconfig eth3 192.168.2.100 netmask 255.255.255.0

The problem that I have is that I can only use one of the NIC's at once.

I can ping any node on 192.168.0.10 but I cant ping on any other. Even when I disable with ifconfig eth0 down I can not ping any other subnet nodes.

It is recommended to tie to DEVICE but I am not so sure where actual network scripts reside that get executed during boot time.

I would appreciate your help

Thanks

Serge

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Multi NIC's different subnets set up
« Reply #1 on: November 26, 2010, 03:21:53 PM »
It is not clear what you are doing, but you need to configure your routes and nameservers.

Offline sergle

  • Newbie
  • *
  • Posts: 5
Re: Multi NIC's different subnets set up
« Reply #2 on: November 26, 2010, 03:39:59 PM »
I have added entries to route table but its not seem to be working.

What I am trying to achieve is to be able to handle packets from all NIC's simultaneously using my own executable.

I receive from eth1 process commands and send on to eth2 and vice versa.

The problem is that I am not able to figure out which extensions I need for full network routing functionality and the other is that it doesn't seem that tce-load -wi xxx command adds them on boot.

I have specified tce=sda1 in menu.lst however the tce-load command complains about not being able to create tce/optional or cd to it...
« Last Edit: November 26, 2010, 03:54:06 PM by sergle »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Multi NIC's different subnets set up
« Reply #3 on: November 26, 2010, 03:48:00 PM »
The last post conflictswith the first post.
Are you using eth0 or not?
It is still not clear what what you have done, and what you are trying to accomplish.

Offline sergle

  • Newbie
  • *
  • Posts: 5
Re: Multi NIC's different subnets set up
« Reply #4 on: November 26, 2010, 03:53:23 PM »
I cant find where TC gets information about eth interfaces

I was hoping to find it here in:

Code: [Select]
/etc/sysconfig/network-scripts/ifcfg-ethX

my routeing table is set up using route add command:

Code: [Select]
route add -host 192.168.0.10 eth1
route add -host 192.168.1.100 eth2
route add -host 192.168.2.100 eht3

The route -n output is :

Code: [Select]
Destination            Gateway               Genmask          Flags     Metric      Ref    Use      Iface
127.0.0.1              0.0.0.0               255.255.255.255   UH         0          0      0       lo
192.168.0.0            0.0.0.0               255.255.255.0     U          0          0      0       eth1
192.168.1.0            0.0.0.0               255.255.255.0     U          0          0      0       eth2
192.168.2.0            0.0.0.0               255.255.255.0     U          0          0      0       eth3
« Last Edit: November 26, 2010, 04:06:24 PM by sergle »

Offline sergle

  • Newbie
  • *
  • Posts: 5
Re: Multi NIC's different subnets set up
« Reply #5 on: November 26, 2010, 04:05:45 PM »
Here is what I want to do:

Set up TC with multiple NIC's on different subnets.

Listen to data coming in on eth1, process it and depending on data received on eth1 communicate with nodes on eth2 or eth3 and respond back to eth1.

Situation example:

eth1, eth2 and eth3 are on different subnets 192.168.0.10, 192.168.1.100 and 192.168.2.100 respectively

Node A on eth1 sends status request packet to Node B (Microcore64 PC)
Node B pings Node C on eth2 and Node D on eth3 and sends  response to Node A on eth1

Hope this helps.

Cheers


Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Multi NIC's different subnets set up
« Reply #6 on: November 26, 2010, 05:35:01 PM »
I would suggest you get a good Linux networking book.
Study up on iptables and forwarding.

Offline sergle

  • Newbie
  • *
  • Posts: 5
Re: Multi NIC's different subnets set up
« Reply #7 on: November 27, 2010, 08:29:39 AM »
I am not trying to use OS to do packet forwarding so iptables and forwarding isnt really relevant. My own executable does that

The bare minimum is all I need is to be able to ping each subnet and its not working. I can only ping one at a time at the moment while others are disabled.

Thanks

Offline gutmensch

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: Multi NIC's different subnets set up
« Reply #8 on: November 27, 2010, 08:56:47 AM »
well you definitely need ip forwarding when you want to connect between different subnets since 192.168.0.0/24 - 192.168.2.0/24 are just not meant to know of each other or how to communicate. ping can be used with the parameter "-I" like
Code: [Select]
ping -Ieth2 192.168.1.101
to explicitly choose the interface on which the ping command should be executed. are all of your nics reachable that way? if not there's still some route problem regarding the different subnets.
If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)