Jump to content
OMRON Forums

eth0 and eth1


daves

Recommended Posts

Has anyone used the two (physical) ethernet sockets on the board?

 

I have the following interfaces file

 

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 195.0.0.4
netmask 255.255.255.0
gateway 195.0.0.4

auto eth1
iface eth1 inet static
address 195.0.0.14
netmask 255.255.255.0
gateway 195.0.0.14

 

I see something weird (or expected?)

 

Connecting a PC to eth0 socket I can ping 195.0.0.4 AND 195.0.0.14.

Connecting a PC to eth1 socket I cannot ping either.

 

I need to use both sockets (a switch/hub cannot be used). How do I configure the system?

 

Dave

Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

I think that you should choose another ip class on eth1.

 

for example,

 

auto eth0

iface eth0 inet static

address 195.0.0.4

netmask 255.255.255.0

gateway 195.0.0.4

 

auto eth1

iface eth0 inet static

address 195.0.1.4

netmask 255.255.255.0

gateway 195.0.1.4

 

then I can connecting a PC to eth0 via 195.0.0.4

and connecting a PC to eth1 via 195.0.1.4

 

Before do that, you should add another IP address such as "192.0.1.123" to your network card in windows network settings.

 

I hope you solve this problem.

 

good luck!

Link to comment
Share on other sites

Thanks for the reply. This is exactly the solution!

 

I think that you should choose another ip class on eth1.

 

In another coincidence I did just this today, as the hardware we wanted to connect to was actually fixed on a different subnet.

 

Luckily the guy training me on the hardware knew something about IP routing and explained how traffic would take the easiest (or metric controlled) route out. So if the destination could be reached through eth0 it would choose that route. Hence my (randomly chosen) similar IPs were not doing what I wanted.

 

I think I followed his explanation and learnt a little about IP routing...

 

[bTW looks like a small typo in your example referencing eth0 in the eth1 section]

 

Cheers

Dave

Link to comment
Share on other sites

  • 2 weeks later...

I haven't used eth1 yet, but I'm using eth0 with our company DHCP server and it sets up all of the network parameters correctly. If you are hooking up devices to eth1 statically this of course won't work for you. I'm curious why you need to use the second port, is there a peripheral that needs direct connection?

 

I always thought it would be a good setup to put a panel PC on eth1 and hook up eth0 to communicate to the company LAN. But then the PC needs to route through the power pmac to get to the outside world and it just gets a bit messy. I'm finding that with a good switch that everything can be put on eth0, but I like having the option of a second port and will probably reserve the use for more "device" kinds of things that don't need access to the LAN.

Link to comment
Share on other sites

  • 3 months later...

This might be a bit late but I've tried the following code in the /etc/network/interfaces and was able to get both eth0 and eth1 ports working independently from each other with proper routing.

 

Modify the IP addresses as required in your network.

 

Please pay close attention to gateway settings. In the case of example file, the eth0 is on a local area network with dedicated router and gateway so the address for the gateway is different that the interface IP address. The eth1 port is however used as a standalone connection to local devices so the gateway is setup to be only the interface itself.

 

1. Create an empty folder on a USB stick called PowerPmacIP on your PC.

2. Unmount and unplug the USB stick from your PC and plug it into the Power PMAC.

3. Cycle power on the Power PMAC and wait for the Power PMAC to boot completely. This will copy the network settings of the Power PMAC into the folder on the USB stick.

4. Unplug the USB from Power PMAC and connect it to your PC.

5. Check the file called interfaces in the PowerPmacIP folder and make sure the data matches your original Power PMAC IP settings.

6. Rename the interfaces file name to interfaces.backup (you can also keep a backup on your PC by copying it to your local HDD.

7. Modify and copy the following code to the USB stick under the PowerPmacIP folder as a file named interfaces (no file name extension).

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 10.34.9.232
netmask 255.255.255.0
gateway 10.34.9.254

auto eth1
iface eth1 inet static
address 192.6.94.232
netmask 255.255.255.0
gateway 192.6.94.232

 

8. Unmount and unplug the USB stick from your PC and plug it into the Power PMAC.

9. Cycle power on Power PMAC. This will update the Power PMAC with the new network settings.

 

Try communication to Power PMAC on both interfaces.

 

If you couldn't communicate, use the backup file created in step 6 and replace the interfaces file on the USB stick and continue from step 8. This should revert your original network settings.

Link to comment
Share on other sites

  • 1 month later...

i have another situation... (i am not a network specialist)

my configuration is given below.

 

i am always physically connected to eth0.

 

when the IP adress of my PC is:

IP : 172.23.0.50

Sub-mask : 255.255.255.0

i can't ping the PPMAC on adress 172.23.1.169 (ping eth1 adress, physically connected to eth0), which is the result i expected

 

when i change the sub-mask of my PC to:

Sub-mask : 255.255.0.0

i am able to ping the PPMAC at the adress 172.23.1.169 (ping eth1 adress, physically connected to eth0), i didn't expect this behaviour

 

could someone enlight me on my "issue".. thank you!!

 

-------------------------------------------

# The loopback network interface

auto lo

iface lo inet loopback

 

auto eth0

iface eth0 inet static

address 172.23.0.165

netmask 255.255.255.0

gateway 172.23.0.165

 

auto eth1

iface eth1 inet static

address 172.23.1.169

netmask 255.255.255.0

gateway 172.23.1.169

Link to comment
Share on other sites

symetrie:

 

This is correct behavior. When your mask is 255.255.255.0, octets 1-3 are fully masked (equal to 255). This means that any IP addresses where octets 1-3 are different from yours will be ignored.

 

The PPMAC is on 172.23.1.169, so the 3rd octet is different from your PC (PPMAC octet 3 = '1', PC octet 3 = '0'). Therefore, the Power PMAC IP address is ignored.

 

When your mask is 255.255.0.0, only octets 1-2 are fully masked. This means that any IP address that doesn't match octets 1-2 will be ignored.

 

Because the Power PMAC is on 172.23.1.169, the first two octets match yours, so it will not be ignored.

 

Short version: if the subnet mask specifies '255' in octet X, the IP address you are connecting to will be ignored unless octet X matches your PC's octet X.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...