[Nottingham] Problems configuring second network card

Mike nottingham at mailman.lug.org.uk
Sun Apr 6 04:58:00 2003


On Sun, 2003-04-06 at 01:07, David Luff wrote:
> Mike writes:
> 
> > 
> > OK 
> > 
> > First off, what does /sbin/ifconfig show (especially for eth1)
> > 
> 
> OK, I'm making some progress now thanks to the various replies, but I've still got a few problems - here goes.
> 
> I've found a sequence by which I can get both cards working and successfully ping the other box  - to do this I start up with eth1 commented out in /etc/network/interfaces:
> 
> # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
> # /usr/share/doc/ifupdown/examples for more information.
> 
> auto lo
> iface lo inet loopback
> 
> auto eth0
> iface eth0 inet dhcp
> 
> #auto eth1
> #iface eth1 inet static
> #address 192.168.0.1
> #network 192.168.0.0
> #netmask 255.255.255.0
> #broadcast 192.168.0.255
> 
> and /sbin/ifconfig gives:
> 
> eth0      Link encap:Ethernet  HWaddr 00:4F:xx:xx:xx:xx  
>           inet addr:80.x.xxx.xxx  Bcast:255.255.255.255  Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:98636 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:10594 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:100 
>           RX bytes:13003245 (12.4 MiB)  TX bytes:2034769 (1.9 MiB)
>           Interrupt:10 Base address:0xf000 
> 
> 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:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0 
>           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
> 
> if I then uncomment all the eth1 lines from /etc/network/interfaces and run ifup eth1 it works, I can ping the other machine, and ifconfig gives:
> 
> eth0      Link encap:Ethernet  HWaddr 00:4F:xx:xx:xx:xx  
>           inet addr:80.x.xxx.xxx  Bcast:255.255.255.255  Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:100405 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:10606 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:100 
>           RX bytes:13111066 (12.5 MiB)  TX bytes:2036133 (1.9 MiB)
>           Interrupt:10 Base address:0xf000 
> 
> eth1      Link encap:Ethernet  HWaddr 00:50:xx:xx:xx:xx  
>           inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:57 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:100 
>           RX bytes:5140 (5.0 KiB)  TX bytes:1164 (1.1 KiB)
>           Interrupt:11 Base address:0xec00 
> 
> 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:6 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0 
>           RX bytes:672 (672.0 b)  TX bytes:672 (672.0 b)
> 
> which all seems fine and dandy.
> 
> However, if I leave the eth1 lines uncommented and reboot then I get problems - bootup stalls at configuring network as before, and after pressing Ctrl-C to get past it ifconfig gives:
> 
> eth1      Link encap:Ethernet  HWaddr 00:50:xx:xx:xx:xx  
>           inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:15 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:100 
>           RX bytes:1752 (1.7 KiB)  TX bytes:0 (0.0 b)
>           Interrupt:11 Base address:0xec00 
> 
> 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:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0 
>           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
> 
> ie. it's actually eth0 that hasn't been brought up.  However, the interesting thing is that ifdown eth1 won't work - it say's eth1 not configured, whereas it doesn't complain about ifdown eth0, although the output of ifconfig is unchanged.  It's almost as if eth0 and eth1 are getting confused somewhere in the configuration stage.
> 
> Anyway, the good point is that I can now get it working by manually uncommenting and starting eth1 - and can ping the other machine.  I've configured the other machine with another 192.168.0 ip address (.0.8 actually), given it the address of this machine as the default gateway (192.168.0.1), and pointed it to the same ntl dns servers that this machine successfully uses.  However, it can't seem to reach them.  I've a feeling this might be related to your next point:

Dont knoiw how critical this is, but if you've got here

comment out eth lines and put 
ifup etc lines in /etc/rc.local


> > Also have you got ip forwarding set up?
> > 
> > ie: what does 
> > 
> > cat /proc/sys/net/ipv4/ip_forward
> > 
> > show (it should be 1) if not echo "1" > /proc/sys/net/ipv4/ip_forward
> > 
> 
> cat /proc/sys/net/ipv4/ip_forward gives 0 :-(
> 
> After echo "1" > /proc/sys... it still gives 0.

no idea why this doesn't work but if you do vi
/proc/sys/net/ipv4/ip_forward and change 0 to 1 this should have the
same effect

> I assume this means that I'm not forwarding any packets from the local machine to the outside, or possibly visca-versca?  Is this likely to be a problem with the setup of my firewall script (MonMotha) or with some other configuration option somewhere?
> 
> Thanks for your help - I feel like I'm getting at least somewhere now.
> 
> Cheers - Dave
> 
> 
> 
> 
> _______________________________________________
> Nottingham mailing list
> Nottingham@mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/nottingham