LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Sharing internet with windows box ? (http://www.linuxquestions.org/questions/linux-networking-3/sharing-internet-with-windows-box-412552/)

GameMaker 02-07-2006 07:50 AM

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

PsypherPunk 02-07-2006 08: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 08: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 08: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 09: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 09: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 09: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 www.google.com 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 09: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 09: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 08: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 08:11 AM

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

trojen 02-10-2006 07: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 11:04 PM.