1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Virtual Wifi with alternative gateway

Discussion in 'Tomato Firmware' started by kellyjelly, Oct 30, 2013.

  1. kellyjelly

    kellyjelly Reformed Router Member

    Hi,

    have normal Wifi, all good, br0 at subnet 192.168.68.0, DHCP active

    made a wl0.1, bridged to br1, subnet 192.168.77.0, no DHCP
    added
    Code:
    interface=br1
    dhcp-range=tag:br1,192.168.77.11,192.168.77.199,255.255.255.0,1440m
    dhcp-option=tag:br1,3,192.168.68.254
    dhcp-option=tag:br1,6,8.8.8.8
    to Advanced/DHCP/custom DNSmasq, works fine, getting IP on wl0.1 with Gateway being 192.168.68.254, but no internet! Ping to br0 ..68.0 timeouts! ping to br1 ..77.0 is okay! Tried
    Code:
    iptables -A FORWARD -i br0 -o br1 -s 192.168.68.0/24 -d 192.168.77.0/24 -j ACCEPT
    iptables -A FORWARD -i br1 -o br0 -s 192.168.77.0/24 -d 192.168.68.0/24 -j ACCEPT
    Firewall rule, not working

    Tried
    Code:
    iptables -I FORWARD -i br1 -o br0 -m state --state NEW -j ACCEPT
    iptables -I FORWARD -i br0 -o br1 -m state --state NEW -j ACCEPT
    iptables -I INPUT -i br1 -m state --state NEW -j ACCEPT
    not working too (tried "iptables -A" too with those commands), rebootet several times and checked if rules are applied in SSH with iptables --list

    [[Purpose: ...254 is an other gateway (RaspberryPi), tunneling thru VPN, Being on br0 and setting ..68.254 as Gateway works fine, result is being tunneled, great! Would be nice to have a 2nd virtual Wifi which is tunneled]]

    Best would be if i just could use br0 for both eth0 and wl0.1 but how could I assign other gateway for devices connecting thru wl0.1?
     
  2. kellyjelly

    kellyjelly Reformed Router Member

    Now switched to a Software Solution on the Clients, which can switch quickly between different IP profiles (DHCP or static address+gateway). Made static DHCP reservations for clients, so they always have same IP, just gatway alters depending to profile used. Software is "TCP/IP Manager", quick access thru taskbar.

    But would like to know solution for future reference.
     
  3. jerrm

    jerrm Network Guru Member

    Basic networking. The gateway has to be on the same subnet as the client. Having a .68.x gateway for a .77.x subnet will never work.
     
    kellyjelly likes this.
  4. kellyjelly

    kellyjelly Reformed Router Member

    What about ditching br1 completly and put wl0.1 on br0, but somehow tell DNSmasq to issue ...254 as gateway for all DHCP requests in wl0.1? Something like
    Code:
    interface=wl0.1
    dhcp-range=tag:wl0.1,192.168.68.200,192.168.77.211,255.255.255.0,1440m
    dhcp-option=tag:wl0.1,3,192.168.68.254
    dhcp-option=tag:wl0.1,6,8.8.8.8
    Problem is that
    Code:
    interface=br0
    dhcp-range=tag:br0,192.168.68.11,192.168.68.199,255.255.255.0,1440m
    dhcp-option=tag:br0,3,192.168.68.1
    dhcp-option=tag:br0,6,8.8.8.8
    somehow overrides my specifications for wl0.1 as it is part of br0. "interface=br0" comes first in /etc/dnsmasq.conf The custom config is appended to the file. Every time DNSmasq starts/restarts /etc/dnsmasq.conf is reset, so changing order does not work. Does DNSmasq even accept "interface=wl0.1" ?
     

Share This Page