Setting up and using eth1 on SAMA5D3 Xplained

Moderator: nferre

marineandme
Posts: 5
Joined: Tue Apr 22, 2014 11:45 am

Setting up and using eth1 on SAMA5D3 Xplained

Wed Apr 30, 2014 11:10 am

Hello,

Has anyone tried using the second ethernet port on the board ? I need to send some data through it but when I try to set it up with /etc/network/interfaces, I get the "Failed to bring up eth1" error.

Any help on the subject would be highly appreciated.

Have a nice day !

The content of my interfaces file :

Code: Select all

auto lo
iface lo inet loopback
allow-hotplug eth0

auto eth0
iface eth0 inet static
hwaddress ether 00:04:56:78:90:12
address 192.168.1.117
netmask 255.255.255.0
gateway 192.168.1.1

auto eth1
iface eth1 inet static
hwaddress ether c2:b2:dc:f2:49:8b
address 192.168.1.118
netmask 255.255.255.0
gateway 192.168.1.1
EDIT :

I finally managed to ping http://www.google.com through eth1 by changing interfaces a bit :

Code: Select all

auto lo
iface lo inet loopback
allow-hotplug eth0
allow-hotplug eth1

auto eth0
iface eth0 inet dhcp
hwaddress ether 00:04:56:78:90:12
address 192.168.1.117

auto eth1
iface eth1 inet static
hwaddress ether c2:b2:dc:f2:49:8b
address 192.168.1.118
netmask 255.255.255.0
gateway 192.168.1.1
With that configuration I can connect both of the interfaces (eth0 and eth1) to the internet but never both at the same time ...
Anyways I'm going to stop trying to use them both at the same time for now but if anyone has information it would still be highly appreciated  :wink:[/size]
blue_z
Location: USA
Posts: 1763
Joined: Thu Apr 19, 2007 10:15 pm

Re: Setting up and using eth1 on SAMA5D3 Xplained

Thu May 01, 2014 3:28 am

marineandme wrote:With that configuration I can connect both of the interfaces (eth0 and eth1) to the internet but never both at the same time ...
How have you determined that only one port is functional at a time?

Beware that ping can get confused as to which interface it should use, especially when several interfaces are in the same subnet (as in your configuration).
Try using the -I switch to specify the interface that ping should use.

Also beware that Linux has (or at least used to have) a quirk called ARP flux. In Linux the IP address is actually associated with the host, not the assigned interface. So it may be possible to get a ping response from a disconnected interface (i.e. its IP address) when there is another operational interface on that host.

Regards
marineandme
Posts: 5
Joined: Tue Apr 22, 2014 11:45 am

Re: Setting up and using eth1 on SAMA5D3 Xplained

Thu May 01, 2014 12:07 pm

blue_z wrote:
marineandme wrote:With that configuration I can connect both of the interfaces (eth0 and eth1) to the internet but never both at the same time ...
How have you determined that only one port is functional at a time?

Beware that ping can get confused as to which interface it should use, especially when several interfaces are in the same subnet (as in your configuration).
Try using the -I switch to specify the interface that ping should use.

Also beware that Linux has (or at least used to have) a quirk called ARP flux. In Linux the IP address is actually associated with the host, not the assigned interface. So it may be possible to get a ping response from a disconnected interface (i.e. its IP address) when there is another operational interface on that host.

Regards
If I plug RJ45 cables in both ports and use :

Code: Select all

ping -I eth0 www.google.com
ping -I eth1 www.google.com
then I can see that only one of them is functional.

So does that mean that both my interfaces should have the same address ? I'm sorry I don't really get it !

Thank you for your quick response :)    
blue_z
Location: USA
Posts: 1763
Joined: Thu Apr 19, 2007 10:15 pm

Re: Setting up and using eth1 on SAMA5D3 Xplained

Fri May 02, 2014 7:35 am

marineandme wrote:...then I can see that only one of them is functional.
It's hard to solve a problem when all you provide is an "executive summary" or your conclusion.
What happens when it's "not functional"?
Which interface does work?
What does `ifconfig` report?
marineandme wrote:So does that mean that both my interfaces should have the same address ?
No.

Are you still using this unusual config file?
marineandme wrote:

Code: Select all

auto lo
iface lo inet loopback
allow-hotplug eth0
allow-hotplug eth1

auto eth0
iface eth0 inet dhcp
hwaddress ether 00:04:56:78:90:12
address 192.168.1.117

auto eth1
iface eth1 inet static
hwaddress ether c2:b2:dc:f2:49:8b
address 192.168.1.118
netmask 255.255.255.0
gateway 192.168.1.1
Remove the "address .." line for eth0, since you've specified DHCP.
What is the range of IP addresses that your DHCP server hands out?
Is 192.168.1.118 outside that range or is it a reserved IP address?
Does ping`ing a local host (i.e. your router) work for both interfaces?

Since you have a DHCP server, have you tried

Code: Select all

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp
which works as expected on my dual-interface SBC.

Regards
marineandme
Posts: 5
Joined: Tue Apr 22, 2014 11:45 am

Re: Setting up and using eth1 on SAMA5D3 Xplained

Fri May 02, 2014 9:19 am

blue_z wrote: Since you have a DHCP server, have you tried

Code: Select all

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet dhcp
which works as expected on my dual-interface SBC.
Thank you very much, I understand now why it didn't work before and that particular interfaces code works fine :D I was a little confused but now I get it :wink:

Return to “SAMA5-based”

Who is online

Users browsing this forum: No registered users and 1 guest