coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
512 stars 258 forks source link

Set chilli wan to other not default wan interface #576

Closed lfdominguez-servinfo closed 11 months ago

lfdominguez-servinfo commented 11 months ago

Hi, configured Chilli as chilli captive portal, all working great. But the thing is that on my router where i have the coova chilli install (OpenWRT) i have a second interface (a vlan one) where I need send the Chilli traffic over there. This interface is different from the main wan, I added policy routing to the router and this work, but I tried to set the WAN IF of chilli, but chilli is always sending the packets of internet to my main wan interface.

lfdominguez-servinfo commented 11 months ago

Found Solution:

if network_find_wan wanif && network_get_ipaddr ipaddr "$wanif"; then

    if network_get_ipaddr ipaddr "$wanif"; then 
- Set policy routing
```sh
ip rule from all iif <chilli_tun> lookup 1000 
ip rule from all iif <wan_if> lookup 1000

ip route add default via <wan_gw_ip> dev <wan_if> table 1000
ip route add <wan_network> dev <wan_if> scope link table 1000
ip route add <chilli_network> dev <chilli_tun> scope link table 1000