LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-19-2014, 12:20 PM   #1
tenk
LQ Newbie
 
Registered: Sep 2014
Posts: 5

Rep: Reputation: Disabled
Routing Wireless AP from eth0 to Wireless connection on wlan0


Hi,
I'd like to develop a wireless AP Web interface to manage some user access/accounts (maybe PHP/SQL) but I'm stuck with the network configuration, maybe someone could help me ?
I'm using a Debian as server connected to internet through a wireless network on wlan0 and a wireless access point on this server on eth0 to serve clients.
My first aim is to simply give access to Internet to the clients then later I'll redirect them on an apache server for authentication and for restricting navigation to some specific sites.
I manage to offer some IP to clients with isc-dhcp-server through the AP and eth0 but I don't manage to route the traffic from clients to wlan0 connection. At this moment, I'm testing with a PS3 and it says "DNS error".

Here are my network configurations:

- Wireless AP on eth0
192.168.121.127 : 255.255.255.0 : 192.168.121.1

- eth0
192.168.121.1 : 255.255.255.0 : 192.168.121.1
Through the Network Manager, in "Routes...", I checked "Use this connection only for resources on its network" else I didn't manage to connect to Internet with the server because it tries to go on eth0 instead of wlan0.

- wlan0
192.168.0.12 : 255.255.255.0 : 192.168.0.254

- my dhcpd.conf is:
Code:
...
subnet 192.168.121.0 netmask 255.255.255.0 {
range 192.168.121.100 192.168.121.150;
option domain-name-servers 192.168.0.254:
option routers 192.168.121.1;
}
...
(I will reduce the network ranges/sizes later according to the number of clients)

At this point there's already something I don't understand well. Is it correct to give 192.168.0.254 as DNS to clients ? Shouldn't it rather be the eth0 IP (192.168.121.1) ?

Then I'm stuck, I guess I need to add a route but I don't understand well the "gw" argument of "route add". I tried this without success:

Code:
route add -net 192.168.121.0 netmask 255.255.255.0 gw 192.168.0.254
Same as for the dhcpd.conf, I wonder if "gw" shouldn't be the eth0 IP because it acts like a gateway for the network 192.168.121.0 ?

Thanks in advance for any advice
 
Old 09-19-2014, 02:39 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
What's output of route command?
 
1 members found this post helpful.
Old 09-20-2014, 04:20 AM   #3
tenk
LQ Newbie
 
Registered: Sep 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hi,
route says me that:
Code:
default		192.168.0.254		0.0.0.0		UG	0	0	0	wlan0
192.168.0.0		*		255.255.255.0	U	0	0	0	wlan0
192.168.121.0		*		255.255.255.0	U	0	0	0	eth0
 
Old 09-22-2014, 02:37 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
You don't need add a route entry. Routing is Ok.
What's DNS IP address for wlan0. The domain-name-servers IP address in dhcpd.conf should be equal to DNS IP address for wlan0.
By the way, red character is dhcpd.conf is wrong, should be ;.

Quote:
subnet 192.168.121.0 netmask 255.255.255.0 {
range 192.168.121.100 192.168.121.150;
option domain-name-servers 192.168.0.254:
option routers 192.168.121.1;
 
1 members found this post helpful.
Old 09-27-2014, 11:05 AM   #5
tenk
LQ Newbie
 
Registered: Sep 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks.
Actually the DNS IP for wlan0, which is the interface connected to the Internet, is 192.168.0.254. I tried it for the DHCP server but it doesn't work. And I guess it's normal because it's a local IP not in the same network of the clients connected to the AP on eth0 (192.168.121.0/24), isn't it ? About the ":" character, I made a mistake while retyping the configuration :/

I'm programmer but I have some gaps in networking. At this moment I'm looking too for alternative solutions like proxy software but I also would like to do this myself for learning purpose.
The final purpose is to offer Internet to 15-20 students in a temporary training classroom. (I strive to tell them for years that networking and programming are two different jobs )
Security is not really important, it's just in order that students do not disperse too much during training (therefore they won't have the WPA Key), but give them access through the open wireless AP to certain websites but also to a local web site with large files to download. At first I wanted to manage the connection access through the local website for the adjacent classrooms do not have access to the local network but it's not really important if I don't manage to do that.
So I guess I need to filter the tcp requests through eth0 then redirect them to the local server if they doesn't match a permitted websites list otherwise redirect them to the gateway. Or redirect all traffic to the local server but after that it seems difficult to redirect to the permitted websites.

If someone knows a software for this, any advice is welcome
 
Old 10-01-2014, 02:26 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
I guess it's normal because it's a local IP not in the same network of the clients connected to the AP on eth0 (192.168.121.0/24).
The client machine can reach any IP in the world if routing is correct. Normally, default route take care of it.
Now we need debugging why DNS is failure.

Can client ping 192.168.121.1, 192.168.0.254?
 
1 members found this post helpful.
Old 10-02-2014, 10:35 AM   #7
tenk
LQ Newbie
 
Registered: Sep 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Yes the client can ping 192.168.121.1 but not 192.168.0.254.
At this moment I'll see 3 solutions:
- install a local DNS server
- forwarding the DNS requests to the gateway 192.168.0.254
- use a public DNS

Do you think I'm right ?

Last edited by tenk; 10-03-2014 at 11:28 AM.
 
Old 10-03-2014, 02:22 PM   #8
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
The routing in your network is wrong somewhere. If you don't solve the issue, DNS can't work even if you try to do something else.
Draw network topology between client and DNS server and dump route table on each machine on path using route command.
 
1 members found this post helpful.
Old 10-03-2014, 05:08 PM   #9
tenk
LQ Newbie
 
Registered: Sep 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
K, thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Turning off wireless power management in wlan0 rc.wireless.conf is ignored vharishankar Slackware 8 09-24-2012 11:39 AM
[SOLVED] Cannot establish connection on port 80 on wlan0 or eth0 dracofhc Linux - Networking 5 12-14-2009 09:08 AM
Routing for eth0 and wlan0 with static IPs on the same network. kelvinlo Linux - Wireless Networking 3 10-15-2007 04:54 PM
Routing between a wired ethernet (internet connection) and a wireless card (home net) ner0 Linux - Wireless Networking 8 11-29-2004 01:12 AM
Broadcom wireless with ndiswrapper: ifconfig wlan0 works; ifup wlan0 fails orangechicken Linux - Wireless Networking 2 04-17-2004 05:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration