on an access point: only the router can connect to the wan
on another access point: everything is router to a vpn and all devices can connect to the wan through this vpn
the first point is because when I go to a hotel and they have a captive portal I don't want to leak from vpn and I must log in with their interface. I plan on using ssh -L ... to log into the captive portal and switch to the vpn-only AP to browse the internet.
my pc => captive =||
captive => wan
my pc => vpn => wan
alternatively I can switch the zone after enabling the connection through the captive portal
I have these interfaces:
captive (DHCP)
lan, wan, wan6, wwan (default)
vpntun (unmanaged)
I set up these firewall rules:
lan => vpnfw (input, output, forward)
wan => reject (input, output) masq
captivefw => wan (output only)
vpnfw => reject (output only) masq
openwrt boots up and connects to the vpn. on ssh I can wget and find that my ip address is the vpn's and I can ping servers. but my pc can't connect to the internet and can't ping anything. both from eth and wifi. the router is connected as a client to another wifi.
with this set up inside the router (root@OpenWrt:~# wget http://myip) it shows the vpn, correctly. but my pc can't connect to the internet. I think too I did not configure the wifi as I want it (AP1, AP2). I'm a bit lost
First of all, let me introduce you to travelmate.
Second, in cases of multiple uplinks it is often necessary to do policy based routing.
Third, interfaces captive and wan are both dhcp on the same interface, which messes up things. Keep one of them and prefer to use peerdns, as the hotspot might not let you query external resolvers.
Fourth, let's verify the routing: ip -4 addr; ip -4 ro list table all; ip -4 ru
I could not have travelmate work with vpn and some captive portals.
I never heard of policy based routing, I can not say my idea is good because I am learning openwrt, perhaps I make it too simple
how?
ok
root@OpenWrt:~# ip -4 addr; ip -4 ro list table all; ip -4 ru
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
7: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
inet 192.168.44.1/24 brd 192.168.44.255 scope global br-lan
valid_lft forever preferred_lft forever
9: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
inet 192.168.24.173/24 brd 192.168.24.255 scope global wlan0
valid_lft forever preferred_lft forever
13: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 500
inet 10.5.0.2/16 scope global tun0
valid_lft forever preferred_lft forever
0.0.0.0/1 via 10.5.0.1 dev tun0
default via 192.168.24.1 dev wlan0 src 192.168.24.173
10.5.0.0/16 dev tun0 scope link src 10.5.0.2
128.0.0.0/1 via 10.5.0.1 dev tun0
216.52.64.164 via 192.168.24.1 dev wlan0
192.168.44.0/24 dev br-lan scope link src 192.168.44.1
192.168.24.0/24 dev wlan0 scope link src 192.168.24.173
broadcast 10.5.0.0 dev tun0 table local scope link src 10.5.0.2
local 10.5.0.2 dev tun0 table local scope host src 10.5.0.2
broadcast 10.5.255.255 dev tun0 table local scope link src 10.5.0.2
broadcast 127.0.0.0 dev lo table local scope link src 127.0.0.1
local 127.0.0.0/8 dev lo table local scope host src 127.0.0.1
local 127.0.0.1 dev lo table local scope host src 127.0.0.1
broadcast 127.255.255.255 dev lo table local scope link src 127.0.0.1
broadcast 192.168.44.0 dev br-lan table local scope link src 192.168.44.1
local 192.168.44.1 dev br-lan table local scope host src 192.168.44.1
broadcast 192.168.44.255 dev br-lan table local scope link src 192.168.44.1
broadcast 192.168.24.0 dev wlan0 table local scope link src 192.168.24.173
local 192.168.24.173 dev wlan0 table local scope host src 192.168.24.173
broadcast 192.168.24.255 dev wlan0 table local scope link src 192.168.24.173
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
network
cat network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'wan'
option device 'eth1'
option proto 'dhcp'
option peerdns '0'
list dns '8.8.4.4'
list dns '8.8.8.8'
config interface 'wan6'
option device 'eth1'
option proto 'dhcpv6'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0.1'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.44.1'
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 0t'
config interface 'captive'
option type 'bridge'
option proto 'static'
option device 'br-lan'
option ipaddr '192.168.44.1'
option netmask '255.255.255.0'
config interface 'wwan'
option proto 'dhcp'
config interface 'vpntun'
option proto 'none'
option device 'tun0'
option type 'bridge'
There is no device for captive other than the AP. This means there is no option device line in captive's definition in /etc/config/network, but there is option network captive in the captive AP definition in /etc/config/wireless.
The only way you're going to connect to captive is via wifi. Once you have captive set up (with the firewall allowing input), connect your PC to captive via wifi and do further changes that way. It should not end up locking out and reverting then.
No,in the rule don't use src, it is wrong anyway.
In the route you want to use interface wwan which will take you to the captive portal.
vpntun is used by default, so there is no need for policy routing.
I possibly need to read somethings up. I don't have enough knowledge to understand what to do, can you send me some page? if I do not understand your comments I can not do a lot