Multiple Network Interfaces

Hello,
I have 2 network cards (both with internet access) which i would like to be able to use at the same time. I have been trying to figure this out for 12 hours now. I am not trying to link 2 networks together or anything, I am just trying to make it so i can have rtorrent running on one interface while i use the other interface for everything else, due to bandwidth constraints.

My routing table currently looks like this:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     192.168.1.1     255.255.255.0   UG    0      0        0 eth1
150.250.131.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         150.250.131.1   0.0.0.0         UG    0      0        0 eth0

i have tried various variations on gateways such as:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     192.168.1.1     255.255.255.0   UG    0      0        0 eth1
150.250.131.0   150.250.131.1   255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

but I can’t seem to get internet access on more than one adapter at a time.

Can anyone tell me how to achieve this?

If your torrents hog bandwidth that will still be the same even if it is possible to do what you ask (I’m not sure of the answer myself).
Try limiting the download speed and disable that dreaded DHT.

I do have DHT disabled, and i did consider throttling bandwidth, but i only have 3mbit/1mbit per network connection, so throttling doesn’t leave me with much.

My theory is if windows can support multiple network interfaces by default, then there has to be a way to do it in linux. Why else would things like rtorrent and ktorrent have options for binding to a specific interface?

There are some networking gurus here, but I ain’t one of them. I just offered some practical advice, albeit seemingly lacking.:slight_smile:

Thanks for the quick response though :slight_smile:

Trying asking in the main openSUSE Mail List (mailto: opensuse+subscribe@opensuse.org), if you don’t get a satisfactory response here
Communicate - openSUSE

What’s the output of ifconfig -a ?
It seems to me that only eth0 got an IP. eth1 doesn’t go anywhere. You should set up both nics to send a dhcp request … if your ISP offers you two IPs.
Try : dhclient eth1 and see if it changes IP.

Also both network cards should be connected to your modem/router with a cable. Otherwise you won’t get two IPs from your ISP.

And you say you do not have two networks, but you seem to have 192.168.1.0/24, 150.250.131.0/24.

Both eth0 and eth1 get IPs:

eth0      Link encap:Ethernet  HWaddr 00:04:5A:4C:8B:5B
          inet addr:150.250.131.51  Bcast:150.250.131.255  Mask:255.255.255.0
          inet6 addr: fec0::b:204:5aff:fe4c:8b5b/64 Scope:Site
          inet6 addr: 2002:96fa:d7de:b:204:5aff:fe4c:8b5b/64 Scope:Global
          inet6 addr: 2002:96fa:8324:b:204:5aff:fe4c:8b5b/64 Scope:Global
          inet6 addr: 2002:96fa:703b:b:204:5aff:fe4c:8b5b/64 Scope:Global
          inet6 addr: fe80::204:5aff:fe4c:8b5b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:41614041 errors:0 dropped:0 overruns:0 frame:0
          TX packets:84254453 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3892769290 (3712.4 Mb)  TX bytes:124574872992 (118803.8 Mb)
          Interrupt:21 Base address:0xce00

eth1      Link encap:Ethernet  HWaddr 00:1F:D0:DD:C3:4B
          inet addr:192.168.1.182  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21f:d0ff:fedd:c34b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5626882 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9083357 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:609672055 (581.4 Mb)  TX bytes:13052465268 (12447.8 Mb)
          Interrupt:27 Base address:0xe000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:257036 errors:0 dropped:0 overruns:0 frame:0
          TX packets:257036 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:174301400 (166.2 Mb)  TX bytes:174301400 (166.2 Mb)


My ISP is my university, so i have no modem, only two ethernet ports in the wall.

It’s true I only am actually connected to one network. I have stuck a linksys wrt54gl in between one of my connections yesterday when I was experimenting so it would would have a
different subnet, and then I never removed it. Otherwise both have 150.250.131.0/24, which I thought was my problem yesterday, although apparently not.

Connect both network cards with cable to router, router to one working port. The router should get the external IP 150…

Disable ipV6, reboot.

Configure both networkcards to use a static IP, each it’s own in the network range, for example 192.168.1.100 and 192.168.1.101, DNS’s 8.8.8.8 and 8.8.4.4, standard gateway 192.168.1.1

This should give a working situation, all other things after this.

That won’t give the OP two connections. If I understand correctly, two connections mean two external IPs. I guess that’s what he needs for his bandwith limitation (not sure though).

Google for ‘NIC bonding’. I guess that’s what you are looking for. Never done it myself and it seems pretty complicated to me.

OK, read all again, see that you have 2 connections, one direct, one via router. Here it comes:

Remove the router. Connect each card with a cable to the wall connector. Remove the configs of both cards from Yast, reconfigure them with DHCP. Please post output of ‘su -c ifconfig’ here.

This should give both an internetconnection, unless some kind of measure has been taken to avoid one host to have multiple connections. Then again the box on the wall may be a switch which shares the bandwidth behind the box…

If you really only have one route to the outside world, then maybe what you are really asking for is traffic shaping to prevent certain protocols from saturating your outside connection. You don’t need multiple interfaces for that, just some traffic shaping rules. This unfortunately involves some firewall and traffic classification magic. Look up LARTC.

The ethernet interface to the LAN is not the bottleneck here anyway, so you might as well just revert to one interface.

On 03/02/2010 07:16 AM, Meatwad wrote:
>
> caf4926;2129097 Wrote:
>> If your torrents hog bandwidth that will still be the same even if it is
>> possible to do what you ask (I’m not sure of the answer myself).
>> Try limiting the download speed and disable that dreaded DHT.
>
> I only have 3mbit/1mbit per network connection, so throttling doesn’t
> leave me with much.

Are you sure about 3/1 per connection?
Is it ADSL? Are you saying that with two addresses you’d have 2 times
3/1? Would that be 6/2 altogether?

How many 3/1 lines do you have available?
Meaning what is your maximum speed in theory?

I think normally you subscribe to a, say 3/1 (or 8/1 or whatever) line.

Normally you would also get up to, say 5 dynamic addresses.
That would normally mean you’d have still 3/1 (or 8/1 or whatever)
bandwidth altogether. That would then be shared among your addresses.
Adding NIC:s would not normally add your speed.

In my case I have ADSL 2+ which means 24/1 in theory, in practice much
less because of my distance to the DSLAM.

Anyway, I get certain bandwidth, that is not per address, it’s altogether.

Just a thought :slight_smile:

>
> My theory is if windows can support multiple network interfaces by
> default, then there has to be a way to do it in linux. Why else would
> things like rtorrent and ktorrent have options for binding to a specific
> interface?

I have two NIC:s here. Not the same reason you want it though.
I’m just saying that it can be done.

Also one NIC can have two addresses if you like.

Vahis

“Sunrise 7:18am (EET), sunset 5:47pm (EET) at Espoo, FI (10:28 hours
daylight)”
http://waxborg.servepics.com
Linux #1 SMP 2010-01-14 18:58:36 +0100 x86_64
4:09pm up 10 days 8:38, 15 users, load average: 0.07, 0.09, 0.08

I notice that even though i have ipv6 disabled and dhcp4 only, I still appear to getting ipv6 addresses:

Here the output of ifconfig:

eth0      Link encap:Ethernet  HWaddr 00:04:5A:4C:8B:5B
          inet addr:150.250.131.51  Bcast:150.250.131.255  Mask:255.255.255.0
          inet6 addr: fec0::b:204:5aff:fe4c:8b5b/64 Scope:Site
          inet6 addr: 2002:96fa:d7de:b:204:5aff:fe4c:8b5b/64 Scope:Global
          inet6 addr: 2002:96fa:8324:b:204:5aff:fe4c:8b5b/64 Scope:Global
          inet6 addr: 2002:96fa:703b:b:204:5aff:fe4c:8b5b/64 Scope:Global
          inet6 addr: fe80::204:5aff:fe4c:8b5b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1054 errors:0 dropped:0 overruns:0 frame:0
          TX packets:150 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:139421 (136.1 Kb)  TX bytes:49270 (48.1 Kb)
          Interrupt:21 Base address:0xce00

eth1      Link encap:Ethernet  HWaddr 00:1F:D0:DD:C3:4B
          inet addr:150.250.131.112  Bcast:150.250.131.255  Mask:255.255.255.0
          inet6 addr: fec0::b:21f:d0ff:fedd:c34b/64 Scope:Site
          inet6 addr: 2002:96fa:d7de:b:21f:d0ff:fedd:c34b/64 Scope:Global
          inet6 addr: 2002:96fa:8324:b:21f:d0ff:fedd:c34b/64 Scope:Global
          inet6 addr: 2002:96fa:703b:b:21f:d0ff:fedd:c34b/64 Scope:Global
          inet6 addr: fe80::21f:d0ff:fedd:c34b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3812 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2766 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2184543 (2.0 Mb)  TX bytes:690400 (674.2 Kb)
          Interrupt:27 Base address:0xa000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:106 errors:0 dropped:0 overruns:0 frame:0
          TX packets:106 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7132 (6.9 Kb)  TX bytes:7132 (6.9 Kb)

Also to clear up the confusion i’m seeing, i live in a university owned apartment complex. My university is my isp. They throttle internet bandwidthn to 3 megabits down, 1 megabit up ~PER~ lan connection. So if I have two connections to there network, then i have effectively 2 3/1 lines. My lan IP address is my external IP.

There is always one automatic IPv4 mapped into IPv6 Link address where IPv4 address is embedded within the IPv6 address. So big is the range of 128 bits that they can afford to allocate 1/2^96 of the range to such addresses. However yours are Global IPv6 addresses so you may indeed be getting them via DHCP. Doesn’t matter, since you don’t use them.

Am I crazy, or do I competely not understand (honest question, no problem if the answer is “yes”)?

In the output I see 2 NIC’s with 2 different IP’s. IP’s obtained through DHCP from the University as an ISP ?
Wouldn’t that be 2 connections?
Also, there’s traffic on both of them.

So if you have two separate IP addresses, surely it’s just a matter of making some destination addresses use a particular interface. You can do this with advanced routing, which is the AR in LARTC.