LinuxQuestions.org
Visit Jeremy's Blog.
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 02-22-2004, 08:15 AM   #1
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Rep: Reputation: 15
routing issue :- have a simple private LAN, with....


...one PC as a "client", and one PC as a "server".

The "server" has two interfaces wlan0 and eth0.

IP of wlan0 is 192.168.1.10
eth0 is 192.168.2.10

on client have the one interface, eth0, 192.168.2.11

From the server i can see the internet, as wlan0 can see 192.168.1.1 which is the "inside" IP of my ADSL wireless router.

I can ping "server" 192.168.2.10 from "client" 192.168.2.11

I cant ping 192.168.1.1 or reach internet, from client

How can I configure the server / client so that requests from the client can see "through" eth0 on the server to wlan0 on the server and thus get out to the outside world.

I'm thinking that i maybe need to have something forwarding the requests on the server passing the request from eth0 to wlan0 .. but not sure where to start.

any help or pointer to some info to get me started would be most appreciated.

Thanks,

Inode100
 
Old 02-22-2004, 09:22 AM   #2
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
oh yeah... i'm using redhat 9.0
 
Old 02-22-2004, 09:26 AM   #3
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
To do this, you will probably need to built a NAT. I suggest you to search on the forum or to read iptables man pages. It is easier than it looks like.

About your client that can't ping the WLan interface, it can be a routing problem on client side or forward on server side.
Type "route -n" on client and check if the client has a default route leading to server (if not, add one, use man route for the correct syntax).

On the server side, type "cat /proc/sys/net/ipv4/ip_forward". If the returned value is "0", then your server drop your client trafic instead of forwarding it (a senseless behavior for a server, but good one for a client). you can activate it typing "echo "1" /proc/sys/net/ipv4/ip_forward".

But you will need a NAT too, if your server send the trafic on the internet without editing source ip adress, your ISP will try to send answers back to the client ip adress and since it is not a valid adress on your wlan, it will never reach you. NAT (Network Adress Translation) will change the source ip for the server ip, send it to internet, grab the answer, change ip back and send it to client.
 
Old 02-22-2004, 09:53 AM   #4
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
ha ha!

thx.

on client I ran :- "route add -net 192.168.1.0 netmask 255.255.255.0 dev eth0"

now i can ping 192.168.1.11, (the wlan0 on the server) from the client.

I can't yet ping 192.168.1.1 (the inside IP to the ADSL router), I guess that'll be where I need NAT on the server, to forward the requests from 192.168.1.11 to the rest of the 192.168.1 subnet (?)

Inode100
 
Old 02-22-2004, 10:03 AM   #5
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Take a look at this thread. It will help you set up packet forwarding.
http://www.linuxquestions.org/questi...threadid=82005

Last edited by Mathieu; 02-22-2004 at 10:05 AM.
 
Old 02-22-2004, 10:15 AM   #6
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
Mathieu, cest bon!

merci beaucoup mon ami.

Inode100
 
Old 02-22-2004, 10:37 AM   #7
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
hmm, ran those commands, substituting wlan0 for eth0 and eth0 for eth1,
but still no luck. off to read some more about ip_forwardng iptables and masquarading etc...

if you have any more useful knowledge of what i could try, to try and see what is wrong, pls post..

many thanks,

Inode100
 
Old 02-22-2004, 10:38 AM   #8
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
btw, this is now my iptables --list output...as seen on my "server"


[root@vader ipv4]# iptables --list
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
 
Old 02-22-2004, 12:35 PM   #9
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
ok, this is where i am now...

I can ping 192.168.1.11 (server wlan0) from 192.168.2.11 (client eth0)

so I figure that my server is forwarding the incoming packets from its own eth0 (192.168.2.10), to wlan0.

now.. the server is not directly connected to internet, the wlan0 is on the 192.168.1.0 subnet. My ADSL wireless router also sits on this subnet and has internal IP address 192.168.1.1 the outside of the ADSL router has my external static IP address. This box masks my internal subnets already, so I don't think i need to set up masqurading on my server (?).

at the moment all I want to do is ping 192.168.1.1 from my client which sits on the second prvt subnet, client ip = 192.168.2.11.

so i'm thinking that I need the wlan0 interface to pass on requests to the rest of the 192.168.1.0 subnet... if my iptables rules on my server and client are flushed and everything on my internal subnets are open, shouldnt "forward" of request happen by default ? hmm, maybe i'll try adding a forward from 192.168.1.11 to 192.168.1.1 rule...
 
Old 02-22-2004, 01:37 PM   #10
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
By default, linux does not automatically forward packets. Like Half_Elf mentioned earlier, you must activate ip_forward.
Since you are using RedHat 9.0, did you follow the steps from this post.
http://www.linuxquestions.org/questi...274#post424274

To see if ip_forward is active, type:
Code:
cat /proc/sys/net/ipv4/ip_forward
Also, what is the default gateway on the server ?
Check your routing table.
Code:
route -n
Tips: To get more info from iptables, add verbose.
Code:
iptables -vL
 
Old 02-22-2004, 02:06 PM   #11
inode100
Member
 
Registered: Oct 2003
Location: London - England, UK
Posts: 63

Original Poster
Rep: Reputation: 15
hi yes i think thats is all ok, I just put the problem under another thread on this forum, with a better explainantion and also with the route -n outputs.. you'll see in that post that i've confirmed the ping is getting from client to server and beyond to another client on the 192.168.1.0 subnet, the problem seems to be with the reply being lost on the way back ....!?!?

thx for help so far...
 
  


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
cannot reach internet from private LAN toodr Linux - Networking 12 10-23-2005 07:44 PM
Routing LAN -> WAN -> LAN with unhelpful router synx13 Linux - Networking 2 06-14-2004 02:35 PM
routing issue :- have a simple private LAN, with.... inode100 Linux - Newbie 4 02-23-2004 03:52 PM
Possible Routing / DNS Issue with Dial-Up connection on LAN connected PC geesloper Linux - Networking 2 12-06-2003 06:55 PM
simple gnuPG private key question. qwijibow Linux - Security 1 10-11-2003 05:57 PM

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

All times are GMT -5. The time now is 09:22 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