routing issue :- have a simple private LAN, with....
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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 (?)
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..
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...
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.
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 ....!?!?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.