OpenWrt Forum Archive

Topic: Backfire on WRT54g v2 and uPnP

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

Trying to get uPnP packages onto my WRT54g v2 running backfire using the instructions  (http://wiki.openwrt.org/doc/howto/upnp?s[]=upnp), but have hit a bit of a problem.

On the LuCi interface Status is Free Space : 0.0B (0%) is reported (which I assume is because squashfs is read-only?).

If I try to update the package list from LuCi I'm told...

Package lists updated: Error (Could not set default destination)

I've ssh'd into the box and tried updating from the CLI and get...

# opkg update
Downloading http://downloads.openwrt.org/backfire/10.03.1-rc4/brcm47xx/packages/Packages.gz.
wget: cannot connect to remote host (78.24.191.177): Network is unreachable
Collected errors:
 * opkg_download: Failed to download http://downloads.openwrt.org/backfire/10.03.1-rc4/brcm47xx/packages/Packages.gz, wget returned 1.

So I went in and checked some settings...

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br-lan

...and the configuration...

# cat /etc/conf/network 

config 'switch' 'eth0'

config 'interface' 'loopback'
    option 'ifname' 'lo'
    option 'proto' 'static'
    option 'ipaddr' '127.0.0.1'
    option 'netmask' '255.0.0.0'

config 'interface' 'lan'
    option 'type' 'bridge'
    option 'ifname' 'eth0.0'
    option 'proto' 'static'
    option 'netmask' '255.255.255.0'
    option 'ipaddr' '192.168.1.2'
    option 'dns' '192.168.1.254'
    option 'username' 'root'
    option 'password' '*********'
    option 'defaultroute' '1'
    option 'peerdns' '0'

config 'interface' 'wan'
    option 'ifname' 'eth0.1'
    option 'proto' 'dhcp'
    option 'type' 'bridge'
    option 'peerdns' '0'
    option 'dns' '192.168.1.254'
    option 'username' 'root'
    option 'password' '*********'
    option 'defaultroute' '1'

config 'switch_vlan' 'eth0_0'
    option 'device' 'eth0'
    option 'vlan' '0'
    option 'ports' '1 2 3 4 5'

config 'switch_vlan' 'eth0_1'
    option 'device' 'eth0'
    option 'vlan' '1'
    option 'ports' '0 5'

...but I've no idea what I need to configure to get this working, and once I've reached the network will opkg download the updated package list to the one place I've got space left  (/dev/mtdblock3)...

# df -h       
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 1.9M      1.9M         0 100% /rom
tmpfs                     6.5M    388.0K      6.2M   6% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock3            1.0M    228.0K    796.0K  22% /overlay
mini_fo:/overlay          1.9M      1.9M         0 100% /

Any insight/advice greatly appreciated.

Cheers

slack---line wrote:

On the LuCi interface Status is Free Space : 0.0B (0%) is reported (which I assume is because squashfs is read-only?).

yes that is what the
/dev/mtdblock3            1.0M    228.0K    796.0K  22% /overlay
is for

as for why it isnt getting the packages it looks like the wan either isnt connecting properly/at all because the route for the wan is not getting added, there is no reason to add the bridge option to the wan port, and the username and password field are not used by static or dhcp, also if your gateway is doublenatted and the modem/router on the wan side is on the 192.168.1.x network just like the lan side on your wrt54g v2 that would create a routing issue as they both have the same route you will have to change either the wan side or the wrt54g to a different subnet

config 'switch' 'eth0'

config 'interface' 'loopback'
    option 'ifname' 'lo'
    option 'proto' 'static'
    option 'ipaddr' '127.0.0.1'
    option 'netmask' '255.0.0.0'

config 'interface' 'lan'
    option 'type' 'bridge'
    option 'ifname' 'eth0.0'
    option 'proto' 'static'
    option 'netmask' '255.255.255.0'
    option 'ipaddr' '192.168.0.2'

config 'interface' 'wan'
    option 'ifname' 'eth0.1'
    option 'proto' 'dhcp'

config 'switch_vlan' 'eth0_0'
    option 'device' 'eth0'
    option 'vlan' '0'
    option 'ports' '1 2 3 4 5'

config 'switch_vlan' 'eth0_1'
    option 'device' 'eth0'
    option 'vlan' '1'
    option 'ports' '0 5'

should work

Tried modifying the lan IP address via LuCi and now can't ssh or bring up LuCi, think I'll need to do a hard factory reset.

Still working fine as a bridge/switch though (as I'm connected through it typing this).

Thanks for the advice, will try and get it sorted once I can connect to it again.

Ok, I've managed to sort this out.

Plugged the powerline cable (from the broadband router) into the "normal" ethernet socket (as oppossed to one of the LAN sockets) and could access the LuCi configuration page on the the router assigned 192.168.1.65, reverted the IP address to 192.168.1.2 and moved the connection back to the LAN socket.

Hey presto I can access the page on 192.168.1.2 again, and now when I ssh in I have the following...

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br-lan
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0.1
0.0.0.0         192.168.1.254   0.0.0.0         UG    0      0        0 eth0.1

Best of all, my PS3 now sees the uPnP served media from my ReadyNAS which is plugged into the bridged WRT54g running OpenWRT, so no need to update packages or install upnp modules.

No idea what it is that I did, as I wasn't tweaking settings other than those described, but its all working now.

Thanks for taking the time to help me.

I hope the above isn't your final setup. Having the same subnet on two interfaces is undefined behaviour. You should move or disable one of them.

Well I know that fundamentally I shouldn't have the connection from the router going into one of the four LAN ports, it should go into the WAN, and then I should have four ports to plug my computer, desktop, NAS and a spare one.

For the time being its working as I need it to.

I've a spare WRT54g (v1.1) that I was using previously which has HyperWRT thibor 15c on it, so I may look into getting that setup (possibly even switching its firmware to OpenWRT which is still updated and maintained unlike its current firmware).

Looks like I'll be sorting things sooner rather than later!

Got home yesterday and without doing anything uPnP is no longer working as there is now only one interface showing...

# 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 br-lan

Been searching through the Wiki and couldn't find anything on how to set this up as a wired bridge/switch.

I'd like (if possible) to have this WRT54g connected via my powerline connection to the router/modem, and allow the router/modem to serve up IP address' to all attached devices, have all ports open, and allow uPnP to pass through seamlessly.

If anyone knows of exisiting documentation/HowTo's that I could work through that would be very much appreciated as I'm yet to find any searching the forums or wider internet.

Cheers.

uci set network.@switch-vlan[0].ports="0 1 2 3 4 5"
uci delete network.@switch-vlan[1]
uci delete network.wan
uci commit network
uci set dhcp.lan.ignore=1
uci commit dhcp
/etc/init.d/firewall disable
reboot
jow wrote:
uci set network.@switch-vlan[0].ports="0 1 2 3 4 5"
uci delete network.@switch-vlan[1]
uci delete network.wan
uci commit network
uci set dhcp.lan.ignore=1
uci commit dhcp
/etc/init.d/firewall disable
reboot

Excellent, thanks for that, my quick rough and ready interpretation would be that that...

1) Sets all ports to be on vlan[0]
2) Removes vlan[1]
3) Remove wan
4) Save changes to network interfaces
5) Don't bother with DHCP for lan (as I want this done by the router/modem)
5) Save the changes to dhcp
6) Disable the firewall (as then uPnP won't need to ask for ports to be opened)
7) Reboot and be good to go

Thank you very much for your help and pointers, really appreciated.

slack---line

After applying the above configuration the device will act as managed switch with wireless bridged to it. No routing, no firewalling, no masquerading, no dhcp.

Had a chance to sit down and tackle this, got the following error...

# uci set network.@switch-vlan[0].ports="0 1 2 3 4 5"
uci: Invalid argument

...but instead opted to change this setting through LuCi, all other changes were made at the command line using uci and went fine.

I can now SSH across all devices on the network, but despite the firewall being disabled the PS3 still can't find the media server, which I can SSH to no problems.

uPnP on the ReadyNAS is running as the following (last) entry in the /var/log/upnp.av.log shows from last night...

[2011/06/29 20:01:17] minidlna.c:717: warn: Starting ReadyDLNA version 1.0.18.2.
[2011/06/29 20:01:17] minidlna.c:808: warn: HTTP listening on port 8200

...and its listening on port 8200.  The router shows the following...

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br-lan

Would setting a static route under (under LuCi's Network > Static Route) to the ReadyNAS (which is assigned to 192.168.1.66) solve this?  If so, how would I specify the port, or do I not need to as a) the firewall is disabled; b) its a routing issue anyway and the discovery packets from the PS3 simply aren't making it through to 192.168.1.66?

The discussion might have continued from here.