Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi All,
I have 2 machines both running Debian Linux 3.0.
Right now, I have one of them connected to the internet through a cable modem.
Any ideas about how I can share internet access between two PCs.
I do have 2 NICs in one of the PCs.
Any help will be appreciated.
Thanks.

Configure and start squid as proxyserver on the machine who has direct acces to the internet. Tell the browser on the other machine to use proxyconnection (http port is configured in the configuration file at the server, the browser on the other machine also needs to know this, also don't close this port in your firewall if you have one inside your internal net).
Wouldn't be too surprised if squid is already waiting on your hardisk to be configured and started.
You might want to check out:
www.squid-cache.org
Other option is to do it by routing, at www.tldp.org howto's are available. Check the catagory network - routing/ip masquerading.

Routing / IP Masquerading option:
Enter these 3 lines on the machine connected to the internet:
modprobe iptable_nat
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward(note: the 2nd line may be wrapping, as there's a space between "-j" and "MASQUERADE")
To make it more permanent, I enter them in a script I call "ipmasq" (due to the ip masquerading), then make it executable (chmod +x ipmasq), and then execute this in my /etc/rc.d/rc.local (may be different in debian) file so it will load upon boot.
On the other machine, simply make the above server your default route ("route add default gw 10.10.10.1 eth0", replacing 10.10.10.1 with your server's ip address).
That's it, and no need to mess with proxy settings in your browser or other internet software. Squid will work, but I think this is easier. The main advantage to using Squid is the caching, but will less useful with only 2 machines.
Note: I'm using Redhat 8, but this should work with any distribution with iptables and later 2.4 kernels. Use "ipfwadm" (2.0 kernel) or "ipfwadm-wrapper" (2.2 kernel) instead of iptables to port this solution to older distributions.
Good luck.

Oops. You may need to modify that 2nd line (of the important 3) to be your ethernet interface (ie eth0) instead of "ppp0". I missed the "through a cable modem" portion of your post. Sorry.

A very basic question? how do i connect the 2 computers?
I have a cable going to the cable modem from the main 'server' machine.
Now, do i connect a crossover cable between the 2 machines?
Like I said before, my main 'server' machine has 2 NICs.
Thanks.

Yes, you can do the crossover cable thing, or you can have both machines connect to a hub or switch, which would give you the option to add more machines in the future.
You could also have the cable modem connect to the hub/switch and then have the two (or more) computers also connected to the hub/switch, then you wouldn't have to have 2 NICs in the "server".

hi All,
I have some questions about Linux and Windows 2000.
I want to share my internet connection to my windows. Let says, i want to make my Linux as a server and my windows 2000 as a working station.
Before i share the internet, do i have to change the configuration of the network for both operating system ??
Second question, how can i share internet connection from Linux to Windows 2000 ??
Do you have any good and understanding refference for it ??
Thank you very much,
Yohanes

Opps,
Sorry, i forget to put information the linux distribution that i have is Red Hat Linux 9.
thanks for your help.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |