Modify

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:

Description

I have the following setup (relevant parts):

network.wan=interface
network.wan.ifname=
network.wan.proto=dhcp
wireless.cfg035a2e=wifi-iface
wireless.cfg035a2e.device=wl0
wireless.cfg035a2e.network=wan
wireless.cfg035a2e.mode=sta

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:

network.wan.ifname=wl0
network.wan.proto=dhcp
network.wan.device=eth0.1

After reboot everything works correctly and routes are set up.
/var/state/network:

network.wan.ifname=wl0
network.wan.device=
network.wan.ipaddr=192.168.0.136
network.wan.netmask=255.255.255.0
network.wan.dns=192.168.0.1
network.wan.gateway=192.168.0.1
network.wan.up=1

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:

network.wan.device=
network.wan.ifname=wl0

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:

/etc/config/network

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' '127.0.0.1'
        option 'netmask' '255.0.0.0'

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

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

/etc/config/wireless

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/config.sh 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   127.0.0.1
        option netmask  255.0.0.0


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


#### 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
192.168.50.0    0.0.0.0         255.255.255.0   U     0      0        0 wl0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br-lan
0.0.0.0         192.168.50.1    0.0.0.0         UG    0      0        0 wl0

And dhcp client is started :

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

Add Comment

Modify Ticket

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


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

 
Note: See TracTickets for help on using tickets.