Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 22 Aug 2017, 03:53
All times are UTC - 4
 Forum index » Advanced Topics » Hardware » Networking
WlanMaker
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 3 [45 Posts]   Goto page: Previous 1, 2, 3
Author Message
rcrsn51


Joined: 05 Sep 2006
Posts: 11533
Location: Stratford, Ontario

PostPosted: Tue 19 Apr 2016, 12:32    Post subject:  

Adding Domain Name Lookup to WlanMaker

Install dnsmasq from a repo, like here.

Create the file /etc/dnsmasq.conf
Code:
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:
udhcpd /tmp/udhcpd.conf

Delete it. Then insert
Code:
killall dnsmasq; dnsmasq

Add a line to /etc/hosts
Code:
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.
Back to top
View user's profile Send private message 
Atle

Joined: 19 Nov 2008
Posts: 598
Location: Oslo, Norway

PostPosted: Sun 01 May 2016, 17:41    Post subject:  

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
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
jamesbond

Joined: 26 Feb 2007
Posts: 3051
Location: The Blue Marble

PostPosted: Wed 04 May 2016, 13:24    Post subject:  

@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 Very Happy

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
Back to top
View user's profile Send private message 
Atle

Joined: 19 Nov 2008
Posts: 598
Location: Oslo, Norway

PostPosted: Wed 04 May 2016, 14:32    Post subject:  

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
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
rcrsn51


Joined: 05 Sep 2006
Posts: 11533
Location: Stratford, Ontario

PostPosted: Wed 04 May 2016, 20:41    Post subject:  

@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.
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 3051
Location: The Blue Marble

PostPosted: Thu 05 May 2016, 05:53    Post subject:  

@rcrsn51 - your method works (in fact, I use similar method here: http://www.lightofdawn.org/wiki/wiki.cgi/LocalDynamicDns). 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:
 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 Smile

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, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 11533
Location: Stratford, Ontario

PostPosted: Thu 05 May 2016, 08:24    Post subject:  

@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?
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 3051
Location: The Blue Marble

PostPosted: Thu 05 May 2016, 08:40    Post subject:  

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.

Quote:
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, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 11533
Location: Stratford, Ontario

PostPosted: Thu 05 May 2016, 08:51    Post subject:  

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?
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 3051
Location: The Blue Marble

PostPosted: Thu 05 May 2016, 09:09    Post subject:  

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:
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.

Quote:
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.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.

Last edited by jamesbond on Thu 05 May 2016, 09:35; edited 1 time in total
Back to top
View user's profile Send private message 
rcrsn51


Joined: 05 Sep 2006
Posts: 11533
Location: Stratford, Ontario

PostPosted: Thu 05 May 2016, 09:19    Post subject:  

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.
Back to top
View user's profile Send private message 
jamesbond

Joined: 26 Feb 2007
Posts: 3051
Location: The Blue Marble

PostPosted: Thu 05 May 2016, 09:40    Post subject:  

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.

Quote:
The advantage of users accessing myserver.com strictly by IP address is that those caching issues can be avoided.
Agreed.
_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.
Back to top
View user's profile Send private message 
Atle

Joined: 19 Nov 2008
Posts: 598
Location: Oslo, Norway

PostPosted: Fri 06 May 2016, 07:09    Post subject:  

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
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
rcrsn51


Joined: 05 Sep 2006
Posts: 11533
Location: Stratford, Ontario

PostPosted: Fri 13 May 2016, 12:47    Post subject:  

@Atle: Whatever happened with this? It looks like jamesbond gave you the exact answer you want four posts back.
Back to top
View user's profile Send private message 
Atle

Joined: 19 Nov 2008
Posts: 598
Location: Oslo, Norway

PostPosted: Sat 14 May 2016, 05:55    Post subject:  

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

I will be back soon...
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Display posts from previous:   Sort by:   
Page 3 of 3 [45 Posts]   Goto page: Previous 1, 2, 3
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Hardware » Networking
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0590s ][ Queries: 14 (0.0059s) ][ GZIP on ]