You are not logged in.

#1 2012-11-14 21:32:00

chord
Member
Registered: 2012-11-07
Posts: 121

How to establish two ethernet connections simultaneously?

Hi!
I have a two-ports router. The first port via ordinary RG-45, and the second port via usb interface.
I want to have both of them to be connected simultaneously. I done this at Gentoo, but can't to do at Arch.
So, what I done exactly:
I found and loaded usbnet module: modprobe usbnet. After that I written appropriate values for new interface (eth1) in /etc/conf.d/network

interface=eth0
address=192.168.1.7
netmask=255.255.255.0
broadcast=192.168.1.255
gateway=192.168.1.1
 
interface=eth1
address=192.168.1.70
netmask=255.255.255.0
broadcast=192.168.1.255
gateway=192.168.1.1

At this point I restarted networking: systemctl stop/start network and checked for new interface:
ip addr | sed '/^[0-9]/!d;s/: <.*$//'
and got output:

1. lo
2. eth0
3. eth1

OK, I decided to test new interface:

ip link set eth0 down
ip link set eth1 up

eth1 started succesfully. But I can't to start eth0 back: 'ip link set eth0 up' does nothing, even I stopping eth1
I tried to reboot and checked eth0 again: eth0 gone. No more eth0...

ip addr | sed '/^[0-9]/!d;s/: <.*$//'
1. lo
3. eth1

Second interface that was eth0 is missing. And I can't get it back.
Where is eth0 and how to connect both interfaces simultaneously?
Thanks in advance for any help.

Last edited by chord (2012-11-14 21:35:07)

Offline

#2 2012-11-14 21:40:14

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: How to establish two ethernet connections simultaneously?

ip addr will only show the interfaces that have an IP address assigned to them.  To see all of the interfaces, use ip link

Are you trying to connect both interfaces to the same subnet at the same time?  That can will cause problems.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2012-11-14 22:32:29

chord
Member
Registered: 2012-11-07
Posts: 121

Re: How to establish two ethernet connections simultaneously?

Thanks for reply!
Yes, really ip link shows both eth0 and eth1. But any way I can't to start eth0 if eth1 exists (no matter started or stopped). The only way I can start eth0 is remove eth1 info from /etc/conf.d/network and restart network. Is this means that I should edit this file and restart network every time I need other interface? Damn, they should be presented simultaneously: both eth0 and eth1. I don't know what cable will be connected on next boot, RG-45 or USB. I need connection on every boot regardless what cable connected: first or second or both. I know that this is possible because of I have it at Gentoo. On boot Gentoo determines which inteface presented and starts one of existing:
If eth0(RG-45) and eth1(USB) presented both than eth1 starts.
If eth0(RG-45) disconnected than starts eth1(USB)
If eth1(USB) disconnected than starts eth0(RG-45).
Automatically, without any kind of manual work.
This is exactly I want to have on Arch.

Offline

#4 2012-11-14 22:36:04

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: How to establish two ethernet connections simultaneously?

chord wrote:

I want to have both of them to be connected simultaneously.

To what point and purpose? You're not going to get faster speeds, and redundancy doesn't seem worth the effort on a home system.

ewaller wrote:

Are you trying to connect both interfaces to the same subnet at the same time?  That can will cause problems.

This.

EDIT:
I think what you're trying (or should be) to do is bonding; joining the 2 physical connections into 1 logical connection, with 1 set of addressing configuration. The kernel takes care of the underlying logic regarding which cable is "up".

Last edited by fukawi2 (2012-11-14 22:36:19)

Offline

#5 2012-11-14 23:17:59

chord
Member
Registered: 2012-11-07
Posts: 121

Re: How to establish two ethernet connections simultaneously?

To what point and purpose? You're not going to get faster speeds, and redundancy doesn't seem worth the effort on a home system.

No I'm not going to get more speed. And no need to have both interfaces active at the same time. I just need to have both of them presented in system. Let only one of them would be active, its enough. And let kernel takes care of which cable is connected and which interface should work.
I have three desktops and 2-ports (USB & RG-45) router. And I don't know, which cable will be free next time when I would to connect one of desktops to router.

So, I can to connect any cable from router to PC and connection should be established, no matter via usb or via rg-45.
It is all I need

Offline

#6 2012-11-15 10:47:02

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: How to establish two ethernet connections simultaneously?

Well, the interfaces going down when one comes up 'may' be some other problem... I don't really have enough info to understand what the problem is there.

In any case, it sounds like what you want is the two interfaces to act like two Switch ports. To do this you want to create a 802.1d Bridge device which is basically a Switch is software.

pacman -S bridge-utils
brctl addbr br0
brctl addif br0 eth0
brctl addif br0 eth1
ifconfig br0 10.0.0.1 netmask 255.255.255.0 up
ifconfig eth0 up
ifconfig eth1 up

The linux bridge device supports VLANS, Spanning Tree Protocol, and you can set Port Priority all the basics.

Last edited by hunterthomson (2012-11-15 10:52:21)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#7 2012-11-15 10:51:50

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: How to establish two ethernet connections simultaneously?

hunterthomson and in general;
Please avoid using ifconfig. It hasn't been maintained for almost a decade.

Last edited by Earnestly (2012-11-15 10:53:05)

Offline

#8 2012-11-15 10:52:54

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: How to establish two ethernet connections simultaneously?

If it works it works tongue If it ain't broke, don't fix it.

iproute2 is super cool. However, in this case none of the new stuff iproute2 offers is needed.

Last edited by hunterthomson (2012-11-15 10:55:20)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#9 2012-11-18 22:16:40

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: How to establish two ethernet connections simultaneously?

I would suggest against the bridge solution, unless you are sure that both cables will never be connected at the same time. Having them both connected and using a bridge will cause a loop and ethernet just does not like that.

If I understand you correctly, a mode-1 (active-backup) bonding configuration will do what you're after. There is good information in the wiki about bonding configuration.

Offline

#10 2012-11-19 07:53:25

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: How to establish two ethernet connections simultaneously?

fukawi2 wrote:

I would suggest against the bridge solution, unless you are sure that both cables will never be connected at the same time. Having them both connected and using a bridge will cause a loop and ethernet just does not like that.

If I understand you correctly, a mode-1 (active-backup) bonding configuration will do what you're after. There is good information in the wiki about bonding configuration.

No, using a bridge device connecting two Hosts to your Arch router/switch will not cause a loop. If you are connecting a full ring of switches, the bridge device has Spanning Tree Protocol, so again no loop.

http://www.cisco.com/en/US/tech/tk389/t … _home.html

Last edited by hunterthomson (2012-11-19 07:59:56)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#11 2012-11-19 07:56:06

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: How to establish two ethernet connections simultaneously?

hunterthomson wrote:

No, using a bridge device connecting two Hosts to your Arch router/switch will not cause a loop.

I'm assuming the "two devices" are actually the 1 router (via Cat5 and USB), and that the router is also acting as a bridge between those 2 interfaces.

That's my understanding of the OP's situation anyway.

Offline

#12 2012-11-19 08:03:14

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: How to establish two ethernet connections simultaneously?

fukawi2 wrote:
hunterthomson wrote:

No, using a bridge device connecting two Hosts to your Arch router/switch will not cause a loop.

I'm assuming the "two devices" are actually the 1 router (via Cat5 and USB), and that the router is also acting as a bridge between those 2 interfaces.

That's my understanding of the OP's situation anyway.

That will not cause a switching loop. STP is enabled by defualt on a bridge device and will take care of that. The packets will only use one inteface, until one link is down. Then the packets will use the other interface.

EDIT: Hum, really the OP didn't really give us enough info.

The way I read it was that the Arch computer is a Router with 2 interfaces 1 RJ-45 and one USB-to-RJ-45. Then that's it. He didn't say anything more about his network. So, origonaly thought that he must be wanting to connect to other computer to this "Arch Router"

|----------------------|
|    Arch                |
|   ____#-B___      |
|--/--------------\----|
|--#1----------#2---|
    |                 |
    |                 |
|--#--|        |--#--|
| H1  |        |  H2 |
|------|        |------|


BUT, This 'could' cause a broadcast storm if the "Switch GW" didn't suport STP.

|----------------------|
|    Arch                |
|   ____#-B___      |
|--/--------------\----|
|--#1----------#2---|
    |                 |
    |                 |
|--#---#---#--#---|
|  Switch GW         |
|----------------------|

Last edited by hunterthomson (2012-11-19 08:39:22)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#13 2012-11-19 23:26:47

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: How to establish two ethernet connections simultaneously?

That was what I was getting at....

Offline

Board footer

Powered by FluxBB