0

My router can be joined by clients.

enable // I'd like to redirect all traffic to an IP (13.37.42.1), I mean any IP and any domain.

disable // Then I d like to be able to disable it. Then clients can browse the web I can do that for IP but not with IPTables.

How can I do that ?

Here is my router config:


dhcpd.conf

option domain-name-servers 13.37.42.1;
default-lease-time 600;
max-lease-time 7200;    
authoritative;
log-facility local7;

    subnet 13.37.42.0 netmask 255.255.255.0 {
        #option domain-name "wifi.localhost";
        option routers 13.37.42.1;  
        option subnet-mask 255.255.255.0;
        option broadcast-address 13.37.0.0;    
        option domain-name-servers 13.37.42.1;
        range dynamic-bootp 13.37.42.15 13.37.42.100;   
    }

dnsmasq.conf

bogus-priv
filterwin2k
no-resolv
no-dhcp-interface=wlan0
interface=wlan0
**address=/#/13.37.42.1**
domain=bbox

Finally, I turned on ip_forward:

echo 1 > /proc/sys/net/ipv4/ip_forward

I guess my system cannot find DNS resolver anywhere (?)

  • What are IP addresses assigned to your router and client? And please give some examples of IP addresses that worked with your browser as you expected. – yaegashi Jul 20 '15 at 11:52
  • broadcast-address should be 13.37.42.255. You should check your clients resolve every domain name to 13.37.42.1 using DNS utility like host, dig or nslookup. And, can you open http://13.37.42.1/ with your browser and see content intended for clients? – yaegashi Jul 20 '15 at 20:33
  • @yaegashi thanks. Yes I can open http://13.37.42.1 with a client browser, and see content indeed. + address=/#/13.37.42.1 resolve every domain name to 13.37.42.1, this is the problem. If I comment address=/#/13.37.42.1, i can get no DNS resolving. Note : I do want my clients access Internet, if they enter www.someting.com, then they do see `www.someting.com' – ArchiT3K Jul 21 '15 at 7:12
  • @yaegashi where shall I add broadcast-address please ? – ArchiT3K Jul 21 '15 at 7:22
  • Modify that in dhcpd.conf: it should be option broadcast-address 13.37.42.255;. If you want clients to normally resolve domain names using dnsmasq, just remove no-resolv, or add server=<upstream DNS address> in dnsmasq.conf. – yaegashi Jul 21 '15 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.