LinuxQuestions.org
Help answer threads with 0 replies.
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 09-06-2013, 12:25 AM   #1
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 240

Rep: Reputation: 31
Multiple network interfaces in debian w/ sporadic connection


I've got a Raspberry Pi running Raspbian (wheezy). I'm working on it to have three network connections ... the ethernet connection and two wireless connections from usb dongles.

So far, I set it up so that any one of them works correctly. Any two of them will act like they're configuring, but if I "ifdown" the primary connection, I'm off the network.

What I want to happen is that all three are connected, and I'm able to bring down any two of them and the other still functions. These may or may not be on the same network (in the end, I'm going to be using just the wireless networks, but will need the ethernet network for initial configuration).

Currently, when I do a networking restart, I get:
SIOCDELRT: No such process

But it appears to configure.

The bigger problem is that when I do an "ifdown eth0", I'm still on the network (I can ping other boxes on the network), but my gateway appears to be gone (I can't ping google.com or 8.8.8.8) ... I get "Network is unreachable". I also get that same error when I execute the ifdown command. So it's finding something it doesn't like. messages doesn't have any information, though.

I've tried this with both dchp and static IP's, so I'm not quite sure what I'm messing up here. I thought dhcp would at least work.

Here's my interfaces file:
Code:
auto lo

iface lo inet loopback

######################
### LAN config
######################

auto eth0
        # if using DCHP
     #iface eth0 inet dhcp
 
        # if using static IP
     iface eth0 inet static
     address 192.168.1.50
     post-up route add default gw 192.168.1.1 metric 1
     post-down route del default gw 192.168.1.1 metric 1
     netmask 255.255.255.0
     network 192.168.1.0
     broadcast 192.168.1.255
     dns-nameservers 192.168.1.1 8.8.8.8

######################
### Wireless config
######################

auto wlan0
        # If using DHCP
     #iface wlan0 inet dhcp

        # If using static IP
     iface wlan0 inet static
     address 192.168.1.51
     post-up route add default gw 192.168.1.1 metric 2
     post-down route del default gw 192.168.1.1 metric 2
     netmask 255.255.255.0
     network 192.168.1.0
     broadcast 192.168.1.255
     dns-nameservers 192.168.1.1 8.8.8.8

        # wpa and wpa2
     wpa-ssid Firefly
     wpa-psk <my key>

#auto wlan1
        # If using DHCP
     #iface wlan1 inet dhcp

        # If using static IP
     iface wlan1 inet static
     address 192.168.1.52
     post-up route add default gw 192.168.1.1 metric 3
     post-down route del default gw 192.168.1.1 metric 3
     netmask 255.255.255.0
     network 192.168.1.0
     broadcast 192.168.1.255
     dns-nameservers 192.168.1.1 8.8.8.8

        # wpa and wpa2
     wpa-ssid Serenity
     wpa-psk <my key>
Here's my ifconfig when both eth0 and wlan0 are up (I haven't done it with all three yet because 1) I have problems with just two and 2) I need one of the usb slots for my keyboard while I'm messing with the network ... hard to ssh in with no network).

Code:
eth0      Link encap:Ethernet  HWaddr b8:27:eb:d4:00:99  
          inet addr:192.168.1.50  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3545 errors:0 dropped:25 overruns:0 frame:0
          TX packets:597 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:409262 (399.6 KiB)  TX bytes:55618 (54.3 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:54 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:5376 (5.2 KiB)  TX bytes:5376 (5.2 KiB)

wlan0     Link encap:Ethernet  HWaddr c8:3a:35:cb:19:4b  
          inet addr:192.168.1.51  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2355 errors:0 dropped:0 overruns:0 frame:0
          TX packets:398 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:347234 (339.0 KiB)  TX bytes:48394 (47.2 KiB)
And my hosts file
Code:
127.0.0.1	localhost
::1		localhost ip6-localhost ip6-loopback
fe00::0		ip6-localnet
ff00::0		ip6-mcastprefix
ff02::1		ip6-allnodes
ff02::2		ip6-allrouters

127.0.1.1	raspberrypi

192.168.1.50	raspberrypi
192.168.1.51	raspberrypi
192.168.1.52	raspberrypi
Any idea what I'm missing?
 
Old 09-06-2013, 03:29 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,893

Rep: Reputation: 163Reputation: 163
The problem is default route. If you want to use multi default routes, multi route tables have to be created.
 
Old 09-16-2013, 02:14 PM   #3
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35
To expand on nini09's reply, Linux network configuration only knows how to declare a single default route (this rule says "send all packets that aren't otherwise matched in my routing table through interface xxx"). In order to solve the problem you are trying to solve, you will have to manage that default route somehow as each interface goes down or comes up.

There are a variety of ways of doing this, none perfect. But the easiest way is to run a routing daemon. The traditional one is called routed, but there are several others that you can find on the Internet.

Hope this helps.
 
Old 09-16-2013, 02:19 PM   #4
JohnLocke
Member
 
Registered: Jun 2004
Location: Denver, Colorado
Distribution: Ubuntu
Posts: 240

Original Poster
Rep: Reputation: 31
Realized I hadn't replied yet, but just wanted to say thanks for both answers!
 
Old 09-16-2013, 02:25 PM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
one more thing to keep in mind for you RPi, make sure you are using a stronger then 1A power supply. if you are trying to power 2 WiFi adapters via USB, Id have nothing less then a 2A psu.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Setting up a DHCP server with multiple network interfaces - Debian Srz0rz Linux - Networking 6 11-19-2016 03:28 PM
[SOLVED] multiple interfaces - intermittent connection td3201 Linux - Networking 2 01-08-2012 05:23 PM
ifup: couldn't read interfaces file "/etc/network/interfaces" debian lenny lorimer73 Linux - Networking 1 08-24-2010 04:47 PM
Fedora 8 - sporadic network connection Wilson08 Linux - Networking 5 08-15-2008 02:17 PM
sporadic network problems on direct connection pfunk Linux - Networking 0 10-14-2004 04:09 PM

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

All times are GMT -5. The time now is 02:19 AM.

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