-   Linux - Networking (
-   -   Sharing internet with windows box ? (

GameMaker 02-07-2006 06:50 AM

Sharing internet with windows box ?
How to share internet with windows machine ?

PsypherPunk 02-07-2006 07:03 AM

How would this be set up? Will the Windows machine have a direct connection and the Linux box will share it or vice versa? Or both going through a router?

weeb0_tikris 02-07-2006 07:24 AM

Your question is unclear. What do you want to do exactly ?
If you want to use windows machine to share internet, why are you in a linux forum ?

GameMaker 02-07-2006 07:58 AM

I want to install linux on one computer in enternet cafe that all of his machine works on windows ... I dont no if it is a direct connection or through a router but it is probably through a router

weeb0_tikris 02-07-2006 08:08 AM

Do you want to log the activity ? If so, you'll have to use a proxy, if you don't want to log the activity, you can use NAT (Network Address Translation) using iptables. There is a lot of tutorial and thread on this forum to help you.

dipenchaudhary 02-07-2006 08:25 AM

use masquerading ...
if connection is on linux box .. u wil have to enable packet forwarding
which is NAT ...
run this as root

modprobe ipt_MASQUERADE
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to <ip of ur ethernet connected to internet>
echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT
iptables -P INPUT DROP #only if the first two are succesful
iptables -A FORWARD -i eth0 -o eth0 -j REJECT

here i assume that eth0 is ur interface connected to internet

dipenchaudhary 02-07-2006 08:28 AM

and then on windows machine ... change ur gateway ip to that of linux machine ... and change dns to one of the entries of /etc/resolv.conf
and then try accessing internet ... shud work and if it does not
then try
nslookup from dos
and if it say time out .. then check ur dns ... it shud be the same server as in ur /etc/resolv.conf

all the best
any problem then post back

dipenchaudhary 02-07-2006 08:30 AM

if u have a dialup connection on linux box ... then replace eth0 with ppp0
and also change the 5 command as
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

all the best

trojen 02-09-2006 08:10 PM

While where on this topic about DNS,

do you have to build your own DNS server on the linux box ( the one sharing your internet connection using NAT) or can you use the DNS server that your dialup modem is connected to?

dipenchaudhary 02-10-2006 07:09 AM

i think .. i did mention to use the entries of /etc/resolv.conf which will contain entries of ur dialup connection ..
yehh u will have to mention the dns address which ur external interface use .. in ur case dialup....

dipenchaudhary 02-10-2006 07:11 AM

why on earth u wud need to create ur own dns server !! sharing internet is not tht cumbersome ..
all the best trojen back .. if any more problem

trojen 02-10-2006 06:10 PM

just thought DNS would work better on your own server. but i managed to get it working using the Dialups DNS.

thanks for that.

All times are GMT -5. The time now is 08:19 PM.