Missunderstanding configuration

Hello,

Why I'm using OpenWrt :

  • I have some issues with my ADSL connection (copper line). I would like to be able to share the internet connection of my phone. I hope that the router will be able to switch/agregate the ADSL et mobil connection.
  • I would like to create a separate wifi network for the guest and my connected objects.

Actually, I have 2 issues with my configuration, I'll explain the first one to start.
If I share the mobil connection => all is fine
If I don't share my mobil connection the other wifi network doesn't work

Could you please help me ?

root@OpenWrt:/etc/config# cat network

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

config globals 'globals'
        option ula_prefix 'fd6a:6563:0528::/48'

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

config device 'lan_dev'
        option name 'eth0.1'
        option macaddr 'f4:f2:6d:f9:73:63'

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

config device 'wan_dev'
        option name 'eth0.2'
        option macaddr 'f4:f2:6d:f9:73:64'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '1 2 3 4 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '0 6t'

config interface 'wwan'
        option proto 'dhcp'

config interface 'wlan1'
        option proto 'none'

root@OpenWrt:/etc/config# cat wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11g'
        option path 'platform/10180000.wmac'
        option htmode 'HT20'
        option txpower '20'
        option country 'FR'
        option channel '11'

config wifi-iface
        option device 'radio0'
        option mode 'ap'
        option ssid 'SlayesHome'
        option network 'lan'
        option encryption 'psk-mixed'
        option key 'xxxxxxxxxxxxxxxx'

config wifi-iface
        option device 'radio0'
        option mode 'ap'
        option encryption 'psk-mixed'
        option key 'xxxxxxxxxxxxxxxxxxxx'
        option ifname 'wlan1'
        option ssid 'SlayesGuest'
        option network 'wlan1'

config wifi-iface
        option network 'wwan'
        option ssid 'vlsm'
        option encryption 'psk2'
        option device 'radio0'
        option mode 'sta'
        option bssid '94:65:2D:7F:16:A5'
        option key 'xxxxxxxxxxxxxxxxxxxxxxx'

root@OpenWrt:/etc/config# cat dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option localservice '1'
        option nonwildcard '0'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv6 'server'
        option ra 'server'
        option force '1'
        option ra_management '1'

config dhcp 'wlan1'
        option 'interface' 'wlan1'
        option 'start' '151'
        option 'limit' '200'
        option 'leasetime' '12h'
        option dhcpv6 'server'
        option ra 'server'
        option force '1'
        option ra_management '1'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'

config host

I think this is a known limitation and a quick workaround would be to use the travelmate.

Thanks a lot for your help, Travelmate is working fine :wink:

May be I setted something wrong, when I'm stopping to share my mobil connection OpenWrt doesn't switch to the ADSL connection. See bellow the differents "route" :slight_smile:

ADSL connection activated :

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.254   0.0.0.0         UG    0      0        0 eth0.2
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0.2
192.168.0.254   *               255.255.255.255 UH    0      0        0 eth0.2

Mobil connection shared :

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.43.220  0.0.0.0         UG    0      0        0 wlan0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0.2
192.168.0.254   *               255.255.255.255 UH    0      0        0 eth0.2
192.168.1.0     *               255.255.255.0   U     0      0        0 br-lan
192.168.2.0     *               255.255.255.0   U     0      0        0 wlan0-2
192.168.3.0     *               255.255.255.0   U     0      0        0 wlan0-3
192.168.43.0    *               255.255.255.0   U     0      0        0 wlan0
192.168.43.220  *               255.255.255.255 UH    0      0        0 wlan0

Route when I'm stopping to share my mobil connection

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0.2
192.168.0.254   *               255.255.255.255 UH    0      0        0 eth0.2
192.168.1.0     *               255.255.255.0   U     0      0        0 br-lan
192.168.2.0     *               255.255.255.0   U     0      0        0 wlan0-2
192.168.3.0     *               255.255.255.0   U     0      0        0 wlan0-3

There is no default gateway (route), I must open the Network settings and click on the Wan "Connect" button to restore the default gateway.

I forgot to set something ?

I think what you require here is something called routing metric. Having more than one gateway/WAN configured tends to end up with packets not knowing where to be routed next. Mwan3 (use multiple WAN connections together) - Prepare and the check the default routing table for the wan interfaces may help.

1 Like

Thanks a lot, I set the metric to 10 for my mobil connection and 20 for my ADSL connection.
It's working perfectly :slight_smile:

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.