It would be great to have a miniHowTo that details this; I'm trying to do the same (basically, replace an airport and small switch with the WRT54G). I wandered through the HowTo pages and thought I did the right things, but ended up not able to talk to the device at all (could ping on the DHCP address it had fetched, but DHCP requests from machines on the LAN or WIFI ports weren't honored, couldn't telnet or ssh into the box). I ended up reloading WhiteRussian rc4 via tftp.
To be specific, what I'm after is a fairly dumb box that gets its address via DHCP and treats the WIFI and all five ethernet ports as bridged together, and passes DHCP requests through (in fact, it probably shouldn't do any firewalling). No NAT.
I'm going to start again and will post exactly what I did. It was hard for me to tell exactly what I could test by ifdown/ifup and what needed a reboot ...
My current thinking is
- add the wlan ether port to vlan:
vlan0ports="0 1 2 3 4 5*"
vlan0hwname=et0
- turn on dhcp for vlan
(edit S05nvram)
lan_proto=dhcp
At this point, I tried
ifdown lan; ifup lan
and the device 'went away'. The wan port had previously acquired 10.0.100.20 via DHCP, and I could still ping that. But no new DHCP requests had come in, and 192.168.1.1 was no longer reachable. I can associate with the unit via WiFi, but not get an address via DHCP (which should come from the remote DHCP server, not the WRT). Huh? Is there some filter/firewall that needs to be turned off first?
Rebooting at this point doesn't help, probably because I changed the lan_proto setting (or because it's not being turned on by default in the boot script.) The box comes up and gets a single DHCP address, but refuses telnet connections there. Time to reflash...
OK, I did that. My first step this time was to change /etc/firewall.user to allow telnet and ssh on the WAN port, so I can reconnect. I tried the same steps again, same result (that's good). I telnet to the WAN port, that works. I say 'ifup lan' and get
root@bosphorus:/# ifup lan
cat: /var/run/br0.pid: No such file or directory
info, udhcpc (v0.9.9-pre) started
debug, Sending discover...
kill: 1: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]
root@bosphorus:/# debug, Sending discover...
debug, Sending discover...
info, No lease, forking to background.
So there's something in the way of the dhcp request getting out. Perhaps because I haven't turned off the wan? I also tried
nvram set wan_proto=none
nvram set wan_ifname=""
nvram set vlan1ports="5"
ifdown wan; ifup lan; ifup wan
but get the same. vlan1 has an IP address (same as it had); vlan0 has no IP address.
My next steps would have been...
- turn off dnsmasq
chmod -x /etc/init.d/S50dnsmasq
Now my understanding gets dicey. Do I need to
nvram unset wan_proto
to stop it from trying to get an address twice?
Do I unser vlan1ports? vlan1hwname?
Do I
nvram unset wlan_ifname
to avoid the firewalling of packets into the device (and turn off NAT)? Or is there a better way to do that?
Thanks.
(What does 'Set wan_ipaddr for management' mean? Set it statically?)
(Last edited by cak on 11 Dec 2005, 23:10)