WlanMaker

Problems and successes with specific brands/models of networking hardware.
Message
Author
User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#31 Post by rcrsn51 »

Adding Domain Name Lookup to WlanMaker

Install dnsmasq from a repo, like here.

Create the file /etc/dnsmasq.conf

Code: Select all

interface=wlan0
listen-address=127.0.0.1
dhcp-range=192.168.100.10,192.168.100.250,12h
Open /usr/sbin/wlanmaker and go to line 19

Code: Select all

udhcpd /tmp/udhcpd.conf
Delete it. Then insert

Code: Select all

killall dnsmasq; dnsmasq
Add a line to /etc/hosts

Code: Select all

192.168.100.1 www.myserver.com
Dnsmasq will use the hosts file to translate domain names into IP addresses.

Start wlanmaker.

Start a web server on 192.168.100.1. Requests from a client for www.myserver.com will be redirected to the local web server.

Atle
Posts: 596
Joined: Wed 19 Nov 2008, 12:38
Location: Oslo, Norway
Contact:

#32 Post by Atle »

Hmmm... I did not really succeed in getting any results in this...

But I shall remaster a SULU004 with my settings...

When i follow the procedure, nothing really happens...

This was both in Fatdog and Lupu...

When trying to log on to the address i get:

This site can’t be reached

myserver.com’s server DNS address could not be found.
DNS_PROBE_FINISHED_NXDOMAIN

only 192.168.100.1 produces result...

Update:

Here is the ISO i have used to do this. The only glitch that i could note was that desktop icons for Wlanmaker was not reproduced and must be pulled out to the desktop from /root/scripts.

But this is the 32 bits version of what i did not get to work after following the post above. I might have done something wrong and i might not.

Never the less i updated the Joomla to 3.5.1 and that is the release version as the Sulu had the beta6 initially.

The file can be downloaded HERE


atle

atle

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#33 Post by jamesbond »

@Atle - I tried to find your post about redirecting all DNS lookup to the machine same machine that hands out the DHCP IP. I can't find that post, so I will answer it here. I will skip the DHCP part - I assume that it has been handled over by wlanmaker. To do what you want to do, you need to enable run dnsmasq with this flag: "-h -2 -b -R -A '/#/your-wlan-ip-from-wlanmaker". This should work with dnsmasq started by wlanmaker assuming that it doesn't hog the DNS port as well (if it does, then tell wlanmaker not to meddle with DNS ports - or somehow, merge the two dnsmasq configs together). Make sure that wlanmaker returns "your-wlan-ip-from-wlanmaker" as the DNS server when handing out IP address via DHCP.

It is easy to test this without wlanmaker. Run "dnsmasq -h -2 -b -R -A '/#/1.2.3.4 -d -q" (the last two extra param is to for debugging purposes so you can see what is happening) in one terminal, then do "echo nameserver 0.0.0.0 > /etc/resolv.conf", then open another terminal and do "nslookup abc.com", or "nslookup google.com", or "nslookup somesault.info" and see what IP address they resolve to. They all should resolve to 1.2.3.4.

The rest of your problem is easy - make sure you don't accidentally enable IP forwarding on your "router/server", so the only machine the students can connect to is your router/server. Your machine can still happily connect to Internet through its other interface (eth0, I suppose?). EDIT: I see from earlier posts that wlanmaker doesn't attempt to share internet, so yes this is already taken care of.

If what I say here is over the top for you - don't worry, I'm sure rcrsn51 knows what I'm talking about. He could help to incorporate what I said above into wlanmaker and automate the entire process for you if he's motivated enough :D
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

Atle
Posts: 596
Joined: Wed 19 Nov 2008, 12:38
Location: Oslo, Norway
Contact:

#34 Post by Atle »

Thanks JamesBond... I saved this page and shall try it offline later. Got all the files ready and saved to test.

As for rcrsn51, i can just cross my fingers and hope, but i believe it will be a amazing result when this is up and going as it changes the way we think network, if not a lot, at least a bit.

Already I have enjoyed the benefits of having Wlanmaker to assist in file transfers as my laptop has a error that messes up USB from time to time(physical damage).

And I believe that with just a little neat script in Moongose, that gives you a upload function and a decent solution for a nice looking download page that can be edited in Seamonkey, would give the 710 a new function that at least me have never seen in Linux distro before. I did not look to much at Moongose, but have realized the choice is very good.

With using Moongose I will not have the remaster problem due to large size as seen with xampp and other bloated progs.

thanks... this will be a exciting evening for me.


ATle

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#35 Post by rcrsn51 »

@Atle: I looked at this again.

1. I did a clean setup of Precise.
2. I installed wlanmaker as usual.
3. I followed the above procedure to install dnsmasq and remove udhcpd.
4. I started wlanmaker.
5. I went to another computer and connected to wlanmaker's WiFi network.
6. I ran: ping www.myserver.com
7. I got a valid response.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#36 Post by jamesbond »

@rcrsn51 - your method works (in fact, I use similar method here: http://www.lightofdawn.org/wiki/wiki.cg ... DynamicDns). But then the name resolution only works for www.myserver.com; not myserver.com or any other domain except you explicitly add it to the /etc/hosts (which in this case, you'd be better off using a different file unless you explicitly also want that the host map www.myserver.com to itself ).

I've got the DHCP + DNS combination to work with the following dnsmasq parameters, assuming that the "wlan1" (provided by wlanmaker) has IP address of 192.168.150.1:

Code: Select all

 dnsmasq -d -q -A '/#/192.168.150.1/' -z -h -b -R --listen-addres=192.168.150.1 --dhcp-range=192.168.150.100,192.168.150.200
The -A switch makes all DNS name to be mapped to the given IP address (192.168.150.1 in this example) - so www.myserver.com, myserver.com, google.com, whateverdomain.abcxyz will always be mapped to 192.168.150.1).

These parameters can be converted into /etc/dnsmasq.conf as needed.

@Atle: yeah, mongoose is a nifty little server that could :)

PS: As an aside, I no longer need to use my "LocalDynamicDNS" above ever since I run mdnsd and libnss_mdns. I can connect to others using ${remote-hostname}.local, e.g. if my remote machine hostname is "abc", I can connect to it using the name abc.local.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#37 Post by rcrsn51 »

@jamesbond: Thanks for that. All Atle wanted was the luxury of clients reaching his web server by name instead of IP address. But your modification suggests something more. If a client launches his web browser with its default home page, like google.com, it would be automatically redirected to myserver.com?

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#38 Post by jamesbond »

rcrsn51 wrote:Thanks for that. All Atle wanted was the luxury of clients reaching his web server by name instead of IP address.
No worries. I was responding to his earlier request that said whatever the URL the clients typed, it should always be redirected to the wlanmaker server. I couldn't find his original request (perhaps his post is buried in the Fatdog64 threads ...), this is the closest one I can find. If the purpose is only to map one single DNS name back to the wlanmaker server, your way is perfectly all right. Sorry for the confusion.
But your modification suggests something more. If a client launches his web browser with its default home page, like google.com, it would be automatically redirected to myserver.com?
No, if the client types google.com, it would still show google.com in his browser. But he is actually connecting to the wlanmaker server. From this point, if wanted, it's (relatively) easy to detect on the server side that if the hostname is not myserver.com, then send a browser redirect to go to myserver.com. This can be done in many ways, e.g. using javascript, or server-side scripting (php, etc).
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#39 Post by rcrsn51 »

jamesbond wrote:No, if the client types google.com, it would still show google.com in his browser. But he is actually connecting to the wlanmaker server.
That should be OK, as long as the client did not get a "page not found" error.

Could you suggest to Atle what options should go on the dnsmasq command line in wlanmaker and what should go in the dnsmasq.conf? My suggested dnsmasq.conf is posted above.

BTW, what happens when the client reboots to an Internet-connected network? Will his browser have issues with caching, where google.com still points to myserver.com?

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#40 Post by jamesbond »

rcrsn51 wrote:Could you suggest to Atle what options should go on the dnsmasq command line in wlanmaker and what should go in the dnsmasq.conf? My suggested dnsmasq.conf is posted above.
I need to lookup the manpage. Basically just convert the short options to the long options. I will edit this post to reflect the answer later.
EDIT:
/etc/dnsmasq.conf

Code: Select all

listen-address=192.168.100.1
address=/#/192.168.100.1
dhcp-range=192.168.100.100,192.168.100.200
bind-interfaces
no-hosts
no-resolv
bogus-priv
no-daemon
log-queries
This is the settings that corresponds to what wlanmaker sets (SUBNET=192.168.100). Remove the two last lines if you want to run dnsmasq in daemon mode. This one does not use the existing /etc/resolv.conf and /etc/hosts (obvious from the option names). Also, for this to work, obviously the line "udhcpd /tmp/udhcpd.conf" must be removed from wlanmaker - let dnsmasq handle the DHCP as well. Hope that helps.
BTW, what happens when the client reboots to an Internet-connected network? Will his browser have issues with caching, where google.com still points to myserver.com?
No issue at all. Everything is handled transparently. If you have a proper Wifi manager, you can, for example, switch to another AP (that is connected to the Internet); this should re-initiate DHCP scans and reset the nameserver and you're good to go - not even a reboot is required. The problematic caching usually happens by the browser - this is usually fixed by pressing Ctrl-F5 just like any other.
Last edited by jamesbond on Thu 05 May 2016, 13:35, edited 1 time in total.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#41 Post by rcrsn51 »

jamesbond wrote:The problematic caching usually happens by the browser - this is usually fixed by pressing Ctrl-F5 just like any other.
That's something that Atle will need to tell his users. Otherwise, he can expect complaints like "Myserver.com broke my browser!".

The advantage of users accessing myserver.com strictly by IP address is that those caching issues can be avoided.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#42 Post by jamesbond »

rcrsn51 wrote:
jamesbond wrote:The problematic caching usually happens by the browser - this is usually fixed by pressing Ctrl-F5 just like any other.
That's something that Atle will need to tell his users. Otherwise, he can expect complaints like "Myserver.com broke my browser!".
Agreed. Browser caching is full of magic because of conflicting standards and the need to keep backward compatibility with Netscape 1.0. They are *not* supposed to do this in the first place, but in certain conditions they do.
The advantage of users accessing myserver.com strictly by IP address is that those caching issues can be avoided.
Agreed.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

Atle
Posts: 596
Joined: Wed 19 Nov 2008, 12:38
Location: Oslo, Norway
Contact:

#43 Post by Atle »

Thanks for the neat dialog here.

The luxury of the client typing whatever, (google.com or puppylinux.org) automatically redirect the client to the webserver address. That is like SPOT ON...

That leaves no room for any need of instructions.

Its like when i take the train, there is a wifi network service present and when i become client there, no matter what i write in the url field of my webbrowser i will be redirected to their captive portal that gives you the usual user terms and log on.

Now we do not need the portal, but just the captive part:-)

I did some efforts to try to test the initial suggestion, but was not capable of getting to anywhere.


But to sum up. When people log on to a wifi, they expect a service and that must be idiot proof. IF at McDonald, near anyone understand how to use their wifi service with the captive portal that is intuitive.

The same appeal to what i "see" as it must be "grandma" friendly in order to have a wider appeal.

Obviously the dialog in technical terms is way beyond and above my level.

As for the failure of mine with the dnsmasq. i shall try this again and it might be that id did not do the www in front of myserver.com


atle

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#44 Post by rcrsn51 »

@Atle: Whatever happened with this? It looks like jamesbond gave you the exact answer you want four posts back.

Atle
Posts: 596
Joined: Wed 19 Nov 2008, 12:38
Location: Oslo, Norway
Contact:

#45 Post by Atle »

I need a little more time to get this straight and get the testing and then some remasters done.

I will be back soon...

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#46 Post by rcrsn51 »

Project updated 2019-10-13.

Post Reply