[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Struggling with "snatty" beast



> From: owner-dev-etrax@xxxxxxx.com 
> [mailto:owner-dev-etrax@xxxxxxx.com] On Behalf Of Mark Richards
> Sent: den 30 juli 2004 21:35
> 
> I am struggling with a real beast, and it is the AXIS 82's 
> second Ethernet port :)
> 
> My attempts at getting a simple nat (snat) iptables 
> implementation to work is failing and I believe that there 
> may be some issue with eth1.
> 
> When I perform:
> 	ifconfig eth1 hw ether "00:40:86:63:10:A0"
> 
> I get the error:
> 	"SIOCSIFHWADDR: Device or resource busy"

The driver for the eth1 interface (drivers/usb/rtl8150.c) does
not allow the MAC address to be set when the interface is up.
The net.eth* initscripts on the devboard 82 never takes down
an interface once it has been started.  The sequence
'net.eth1 stop && net.eth1 start' will unconfigure the IP
address on eth1 without downing it and then the start command
will try to set the HW address.  The warning is harmless as it
does not break anything except that the HW address setting does
not take (which is probably ok in your case as I don't think you
want to change the HW address from what it it set to in
/etc/conf.d/net.eth1).

If you want to fix this it should be ok to add an 
'ifconfig $iface down' in the stop clause of /etc/init.d/net.
I don't know why this is not done in the script now.

Btw, based on the ifconfig output below it seems as you are
trying to set the HW address of eth1 to the same as eth0.
I guess that was a typo, since it is a bad idea to introduce
MAC address conflicts.

> In dmesg:
> 
> 	eth0 initialized
> 	eth0: changed MAC to 00:40:8C:CD:00:00
> 	rtl8150.c: eth1: rtl8150 is detected
> 	eth0: changed MAC to 00:40:8C:63:10:A0
> 	00:40:8C:63:10:<7>eth0: no IPv6 routers present
> 	eth1: no IPv6 routers present
> 	eth0: changed MAC to 00:40:8C:63:10:A0
> 
> It seems as if eth1 is not getting its MAC address set during 
> the init phase.  Could this be the problem here?
> 
> Basically, if I issue /etc/init.d/net.eth1 restart, things 
> seem to work.  If I issue /etc/init.d/net.eth1 stop and then 
> /etc/init.d/net.eth1 start, I get a failure.  Only restart 
> works properly (or so it appears).
> 
> Here's the configuration for the AXIS 82:
> 
> eth0      Link encap:Ethernet  HWaddr 00:40:8C:63:10:A0
>           inet addr:192.168.1.90  Bcast:192.168.255.255  
> Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:1596 errors:0 dropped:0 overruns:0 frame:1
>           TX packets:655 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:107253 (104.7 kiB)  TX bytes:88628 (86.5 kiB)
>           Interrupt:17 DMA chan:1
> 
> eth1      Link encap:Ethernet  HWaddr 00:40:8C:63:10:A1
>           inet addr:192.168.0.90  Bcast:192.168.255.255  
> Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:61 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000
>           RX bytes:7200 (7.0 kiB)  TX bytes:3070 (2.9 kiB)
> 
> I don't have a default gateway set for eth1.  Should I?  If 
> so, what should it be set to?  eth0's default gateway is the 
> router I use for the internal lan, which is at 192.168.1.1

No, but you do need to make sure that the routing table is correct
before starting with the NAT stuff.  AFAIK the default route for
NAT box should be the next hop to the external net, and you need to
have routes set up for the internal network(s).  What is the
output of route on the devboard?  On the client machine?
 
> When I start udhcpd (the AXIS dhcp server) I see in 
> ./var/log/messages:
> 
> Jul 30 14:19:06 AxisProduct udhcpd: udhcp server (v0.9.8) 
> started Jul 30 14:19:06 AxisProduct udhcpd: SIOCGIFADDR 
> failed, is the interface up and configured?: Cannot assign 
> requested address Jul 30 14:19:21 AxisProduct udhcpd: udhcp 
> server (v0.9.8) started Jul 30 14:20:30 AxisProduct udhcpd: 
> sending OFFER of 192.168.0.20 Jul 30 14:20:30 AxisProduct 
> udhcpd: sending ACK to 192.168.0.20
> 
> It appears that the client gets the ip (from eth1), but I am 
> worried about that SIOCGIFADDR error.

How did you start udhcpd?  I took a quick look at the code and
it appears as udhcpd should have terminated after the SIOCGIFADDR
error message.

Henrik