Re: [Hampshire] Routing traffic

Top Page

Reply to this message
Author: Simon Capstick
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Routing traffic
Just a small correction to that /etc/network/interfaces config...

Simon Capstick wrote:
> John Hunt wrote:
>> root@feeg:~# /etc/init.d/networking restart
>>
>>
>> root@feeg:~# cat /etc/network/interfaces auto lo
>> iface lo inet loopback
>>
>> auto eth0
>> iface eth0 inet dhcp
>>
>> root@feeg:~# ifconfig eth0      Link encap:Ethernet  HWaddr 
>> 00:0A:E4:35:08:A3            inet addr:192.168.1.249  Bcast:192.168.1.255
>> Mask:255.255.255.0
>>           inet6 addr: fe80::20a:e4ff:fe35:8a3/64 Scope:Link
>>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>           RX packets:27 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:338 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:1000           RX bytes:5492 (5.3 
>> KB)  TX bytes:40143 (39.2 KB)
>> eth1      Link encap:Ethernet  HWaddr 00:12:F0:B6:67:38            
>> inet addr:192.168.1.100  Bcast:192.168.1.255
>> Mask:255.255.255.0
>>           inet6 addr: fe80::212:f0ff:feb6:6738/64 Scope:Link
>>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>           RX packets:1 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:1 errors:0 dropped:0 overruns:0 carrier:4
>>           collisions:0 txqueuelen:1000           RX bytes:1599819821 
>> (1.4 GB)  TX bytes:75852497 (72.3 MB)
>>           Interrupt:11 Memory:d0200000-d0200fff
>> 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:56002 errors:0 dropped:0 overruns:0 frame:0
>>           TX packets:56002 errors:0 dropped:0 overruns:0 carrier:0
>>           collisions:0 txqueuelen:0           RX bytes:8693378 (8.2 
>> MB)  TX bytes:8693378 (8.2 MB)

>>
>> Not too sure how my eth0 picked up an address like that, but hey!
>>
>> root@feeg:~# brctl addbr mybridge
>> root@feeg:~# brctl addif mybridge eth0
>> root@feeg:~# brctl addif mybridge eth1
>> root@feeg:~# brctl show
>> bridge name     bridge id               STP enabled     interfaces
>> mybridge                8000.000ae43508a3       no              eth0
>>                                                         eth1
>> Seems in order..
>> However, my laptop now has no connectivity! I can't ping my router
>> (192.168.1.1) etc. I'm not sure about pinging the debian box (it's
>> totally headless) as I don't know it's IP address.

>>
>> Here's an output of route after the above commands:
>> root@feeg:~# route
>> Kernel IP routing table
>> Destination     Gateway         Genmask         Flags Metric Ref    Use
>> Iface
>> 192.168.1.0     *               255.255.255.0   U     0      0        0
>> eth1
>> 192.168.1.0     *               255.255.255.0   U     0      0        0
>> eth0
>> link-local      *               255.255.0.0     U     1000   0        0
>> eth0
>> default         192.168.1.1     0.0.0.0         UG    0      0        0
>> eth1
>> default         192.168.1.1     0.0.0.0         UG    100    0        0
>> eth0

>>
>> I'm not sure what's going on, but it seems as soon as I bring up the
>> bridge connectivity just goes.
>>
>> Any ideas?
>> Thanks very much in advance!
>>
>> John.
>>
>>
>
> I think Vic's right about assigning the bridge an IP address rather than
> the interfaces. /etc/network/interfaces should be something like
> this. Do backup your /etc/network/interfaces file first so you can
> restore it if needs be.
>
> Simon
>
>
> auto lo
> iface lo inet loopback
>
> auto mybridge
> iface mybridge inet dhcp
> pre-up ifconfig eth0 down
> pre-up ifconfig eth1 down
> pre-up brctl addbr mybridge
> pre-up brctl addif mybridge eth0
> pre-up brctl addif mybridge eth1
> pre-up ifconfig eth0 up
> pre-up ifconfig eth1 up
> post-down ifconfig eth0 down
> post-down ifconfig eth1 down
> post-down brctl delbr mybridge
>


Scrub this ....
> auto eth0
> iface eth0 inet static
> address 0.0.0.0
>
> auto eth1
> iface eth0 inet static
> address 0.0.0.0
>


... and replace with just:

auto eth0
auto eth1

Simon