LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-12-2014, 04:12 AM   #1
rowan
LQ Newbie
 
Registered: May 2014
Posts: 7

Rep: Reputation: Disabled
Dual Ethernet interface with Linux not working correctly


I have a zync card running linux, with two ethernets ports with a dual PHY and only one MDIO controller.

When I run ifconfig I can see both eth0 and eth1 and netstat -rn shows the two entries for eth0 and one for eth1.

However I am witnessing connection issues, there is something not quite right with the hookup of the dual MACs.

eth1 does not seem to come up properly; get a ip: RTNETLINK answers: File exists error. Board can crash when trying to reboot.

More specifically, ifdown hangs. For example:

run-parts /etc/network/if-down.d
ip addr flush dev eth0
ip link set eth0 down
xemacps e000c000.ps7-ethernet: link down
run-parts /etc/network/if-post-down.d

Any advice on how to handle this issue would be very much appreciated.

I would also like to add that when creating SSH connection using, eg, Putty and Filezilla, the connection seems to be made ok but then often dies unexpectedly after a minute or so.

Last edited by rowan; 05-12-2014 at 04:14 AM. Reason: Adding additional information.
 
Old 05-12-2014, 04:38 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,278

Rep: Reputation: 148Reputation: 148
Copy your interface configuration,
1. cat /etc/sysconfig/network-scripts/ifcfg-eth0
2. cat /etc/sysconfig/network-scripts/ifcfg-eth1

And copy the following,
1. ip a
2. netstat -rn
3. dmesg | grep eth0 and eth1
 
Old 05-12-2014, 04:49 AM   #3
rowan
LQ Newbie
 
Registered: May 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
# cat /etc/network/interfaces
# Configure Loopback
auto lo
iface lo inet loopback

# Configure Ethernet interface 0
# allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.1.3
gateway 192.168.1.1
netmask 255.255.255.0

# Configure Ethernet interface 1
# allow-hotplug eth1
auto eth
iface eth1 inet static
address 192.168.3.210
gateway 192.168.3.1
netmask 255.255.255.0
# dns-nameservers 192.168.3.141 192.168.3.143

# iface eth1 inet dhcp


ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0a:35:00:01:22 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.3/24 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::20a:35ff:fe00:122/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:0a:35:00:01:23 brd ff:ff:ff:ff:ff:ff
inet 192.168.3.210/24 scope global eth1
valid_lft forever preferred_lft forever
inet6 fe80::20a:35ff:fe00:123/64 scope link
valid_lft forever preferred_lft forever
4: tunl0: <NOARP> mtu 0 qdisc noop
link/ipip 0.0.0.0 brd 0.0.0.0
5: sit0: <NOARP> mtu 1480 qdisc noop
link/sit 0.0.0.0 brd 0.0.0.0

netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1

# dmesg | grep eth0 and eth1
grep: and: No such file or directory
grep: eth1: No such file or directory


I do not have separate files for eth0 and eth1. Are these supposed to be automatically generated or am I supposed to generate them as part of the installation process.
 
Old 05-12-2014, 04:51 AM   #4
rowan
LQ Newbie
 
Registered: May 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
Please note this is not a standard linux distribution but a xilinx special.
 
Old 05-12-2014, 10:58 AM   #5
rowan
LQ Newbie
 
Registered: May 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
Having been trawling through xilinx forums all day I found a couple of things to try. After modifying the device tree so that both eth0 and eth1 reference the mdio, rather than just eth0 and eth1 just having the phy handle phy1. Now when we start up there is a similar directory structure for both eth0 and eth1 rathre than the statistics etc just comming under eth0.

Also modified the driver xilinx_emacps.c function static void xemacps_adjust_link(struct net_device *ndev) adding the lines
if (lp->enetnum == 1)
xemacps_mdio_read(lp->mii_bus, lp->phy_dev->addr, 0);


to the end of the function.
eth0 is now working fine and ifdown and ifup work without crashing.

However we are still seeing the RTNETLINK answers: File exists error at reboot and also when ever we check the operational status of eth1 it it always down even after running ifup eth1, which nolonger errors.

Also can nolonger putty into the devide using the ip address for eth0.

Any further suggestions for how I can get the second ethernet port up and running greatfully received.
 
Old 05-17-2014, 12:06 AM   #6
johnsoto
LQ Newbie
 
Registered: May 2014
Location: USA
Posts: 4

Rep: Reputation: Disabled
Dual Ethernet interface with Linux not working correctly

Quote:
Originally Posted by kirukan View Post
Copy your interface configuration,
1. cat /etc/sysconfig/network-scripts/ifcfg-eth0
2. cat /etc/sysconfig/network-scripts/ifcfg-eth1

And copy the following,
1. ip a
2. netstat -rn
3. dmesg | grep eth0 and eth1
first do this action. you get good result....
 
Old 05-18-2014, 10:43 AM   #7
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
I know nothing of your distro, so feel free to ignore me. However, I see a typo (based on typical Unix/Linux conventions:

~~~
# Configure Ethernet interface 0
# allow-hotplug eth0
auto eth0 <-- Says 'auto ethx'
iface eth0 inet static

...

# Configure Ethernet interface 1
# allow-hotplug eth1
auto eth <-- Says 'auto eth' (no 'x')
iface eth1 inet static
~~~

Seems as if the lack of a numerical designation might cause issues if you are going to expect it to be called "eth1", and you don't declare it at the beginning of the config.
 
Old 05-19-2014, 03:25 AM   #8
rowan
LQ Newbie
 
Registered: May 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thanks for the advice I re-checked the /etc/network/interfaces file and it is now correct:

# cat /etc/network/interfaces
# Configure Loopback
auto lo
iface lo inet loopback

# Configure Ethernet interface 0
# allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.1.3
gateway 192.168.1.1
netmask 255.255.255.0

# Configure Ethernet interface 1
# allow-hotplug eth1
auto eth1
iface eth1 inet static
address 192.168.3.210
# gateway 192.168.3.1
netmask 255.255.255.0
# dns-nameservers 192.168.3.141 192.168.3.143

# iface eth1 inet dhcp

RTNETLINK answers: File exists error also cured by using the same gateway fot eth0 and eth1.

Both ethernet connection now appear to be up and working ok.
 
Old 05-19-2014, 08:39 AM   #9
GaWdLy
Member
 
Registered: Feb 2013
Location: San Jose, CA
Distribution: RHEL/CentOS/Fedora
Posts: 457

Rep: Reputation: Disabled
So it was just a typo? Happy to hear!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Name of Ethernet interface in Linux nima0102 Linux - Networking 2 04-29-2010 03:37 AM
Receive Ethernet VLAN frame on the native ethernet interface (raw packet socket) scottbiker Linux - Networking 0 07-13-2009 03:49 AM
full screen not working correctly on separate xscreens (dual head set up) LauMars Linux - Software 1 09-14-2007 08:55 AM
HELP- ethernet device not working correctly vdo Linux - Hardware 1 08-24-2005 10:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration