Opened 10 years ago

Closed 9 years ago

#3830 closed defect (worksforme)

Trunk fails to setup routes with Wifi as WAN

Reported by: anonymous Owned by: developers
Priority: normal Milestone:
Component: packages Version:
Keywords: Cc:


I have the following setup (relevant parts):


If I set these options and do /etc/init.d/network restart the interface gets an IP-address from WLAN but the default route is not set up correctly.

/var/state/network says:


After reboot everything works correctly and routes are set up.


But when I then do /etc/init.d/network restart again it fails like seen above (gets IP-Address form DHCP but does not set up route) with /var/state/network:


Platform: brcm2.4 on WRT54GL
Revision: ~12039 I think

Attachments (0)

Change History (6)

comment:1 Changed 10 years ago by florian

Could you show your /etc/config/wireless and /etc/config/network it seems to me like a misconfiguration occured.

comment:2 Changed 10 years ago by anonymous

I don't think it is any misconfiguration because it works after doing a reboot until running /etc/init.d/network restart but anyway:


config 'switch' 'eth0'
        option 'vlan0' '0 1 2 3 5*'
        option 'vlan1' '4 5'

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

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

config 'interface' 'wan'
        option 'proto' 'dhcp'
        option 'ifname' ''


config 'wifi-device' 'wl0'
        option 'type' 'broadcom'
        option 'channel' '5'
        option 'disabled' '0'

config 'wifi-iface'
        option 'device' 'wl0'
        option 'network' 'wan'
        option 'mode' 'sta'
        option 'ssid' 'xxx'
        option 'encryption' 'psk2'
        option 'key' 'xxx'

comment:3 Changed 10 years ago by florian

config interface wan section should have "option ifname "wl0" set.

comment:4 Changed 10 years ago by anonymous

That would not make any sense because if I would setup several WIFI-VIFs the interface name is not clear. Also it would create an unclear relationship between wireless and network.

And not to forget: It does work after rebooting but just not after /etc/init.d/network restart.

comment:5 Changed 10 years ago by florian

If you setup several wifi interfaces, the first one is wl0, second wl0.1 etc. Plus, if you take a look at /lib/network/ it expects ifname to be set to start the dhcp client accordingly.

I admit the reboot issue sounds weird.

comment:6 Changed 9 years ago by florian

  • Resolution set to worksforme
  • Status changed from new to closed

Ok, so this was just tested against r12249 :

/etc/config/network/ :

#### VLAN configuration
config switch eth0
        option vlan0    "0 1 2 3 5*"
        option vlan1    "4 5"

#### Loopback configuration
config interface loopback
        option ifname   "lo"
        option proto    static
        option ipaddr
        option netmask

#### LAN configuration
config interface lan
        option type     bridge
        option ifname   "eth0.0"
        option proto    static
        option ipaddr
        option netmask

#### WAN configuration
config interface        wan
        option ifname   "wl0"
        option proto    dhcp

/etc/config/wireless :

{{{config wifi-device wl0

option type broadcom
option channel 5

config wifi-iface

option device 'wl0'
option network 'wan'
option mode 'sta'
option ssid 'OpenWrt'


Routing table :

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     0      0        0 wl0   U     0      0        0 br-lan         UG    0      0        0 wl0

And dhcp client is started :

  763 root       2380 S   udhcpc -t 0 -i wl0 -b -p /var/run/ -R

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.