how to access internet from a linux machine via a linux machine as gateway
hello all,
i've two systems and have windows XP as well as slackware 10.0 installed on both. modem is connected to one system.....let say to system1 now wat i'm trying is that what ever o/s running on system1........the other system, lets say system2, shud have access to internet....... i.e the following combinations: system1(modem connected) system2 1> XP .......................................... XP 2> XP .......................................... Linux 3> LInux ......................................... XP 4> Linux ......................................... Linux out of these i know configuration for first case only (being a window user .lol )...... NFS is not enabled on linux.......actually i was trying but didn't get success. any sort of help will be highly appreciable. regards |
You need two network connections on system1. This will typically be two different pieces of hardware. It sounds like you've got a telephone modem, so that's one. Do you have an ethernet card/port as well?
|
ok ruudra so yopu say that you know how to get the connection going for XP (i assume you mean using Internet connection sharing) so what you need is to do the same thing under linux.
To do this you will need a firewall. One of the most common uses for a firewall is to share an Internet connection using network address translation (NAT). There is a special type of NAT that does just what you need called masquerading. basically the way it works is system 2 will make a request for something outside your network (so on the internet for example) and that request will go to your default gateway (which you would have set to system 1). System 1 will get the request, re-write it before sending it out to make it look like it had sent the request. When the reply comes back system 1 will look up who sent the request in the first place and re-write the packet again so that it goes back to system 2 looking like it has come from the internet directly. It is quite neat really. Anyway there are a variety of pre-made firewalls you can load up and try or if your feeling game check out the netfilter homepage let us know how you go |
On the 'server' setup the dialup connection, local network, ip forwarding, iptables NAT Masq and a dhcp server.
Then plug anything using dhcp into the local network and it will connect. If you prefer a static ip then use that instead of dhcp. you will need to configure the clients interface for static ip. |
Thnx guys for helping me out......
I did wat "suteh" adviced me................just installed a firewall "shorewall"......and now i can access internet from system 2 also. thnx once again !!! regards |
well good that the problem is solved
but one thing needs to be corrected here that shorewall is not a firewall,the firewall is IPTABLES shorewall is an interace to iptables regards |
All times are GMT -5. The time now is 01:37 AM. |