Dual Ethernet interface with Linux not working correctly
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
# 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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.