LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 02-07-2006, 07:50 AM   #1
GameMaker
LQ Newbie
 
Registered: Feb 2006
Posts: 22

Rep: Reputation: 15
Sharing internet with windows box ?


How to share internet with windows machine ?
 
Old 02-07-2006, 08:03 AM   #2
PsypherPunk
Member
 
Registered: Jul 2005
Location: Leeds, UK
Distribution: SuSE 10.0
Posts: 108

Rep: Reputation: 15
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?
 
Old 02-07-2006, 08:24 AM   #3
weeb0_tikris
LQ Newbie
 
Registered: Sep 2003
Posts: 8

Rep: Reputation: 0
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 ?
 
Old 02-07-2006, 08:58 AM   #4
GameMaker
LQ Newbie
 
Registered: Feb 2006
Posts: 22

Original Poster
Rep: Reputation: 15
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
 
Old 02-07-2006, 09:08 AM   #5
weeb0_tikris
LQ Newbie
 
Registered: Sep 2003
Posts: 8

Rep: Reputation: 0
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.
 
Old 02-07-2006, 09:25 AM   #6
dipenchaudhary
Member
 
Registered: Jan 2006
Location: india
Distribution: FEDORA CORE 3
Posts: 103

Rep: Reputation: 15
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
 
Old 02-07-2006, 09:28 AM   #7
dipenchaudhary
Member
 
Registered: Jan 2006
Location: india
Distribution: FEDORA CORE 3
Posts: 103

Rep: Reputation: 15
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
 
Old 02-07-2006, 09:30 AM   #8
dipenchaudhary
Member
 
Registered: Jan 2006
Location: india
Distribution: FEDORA CORE 3
Posts: 103

Rep: Reputation: 15
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
 
Old 02-09-2006, 09:10 PM   #9
trojen
LQ Newbie
 
Registered: Feb 2006
Posts: 2

Rep: Reputation: 0
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?
 
Old 02-10-2006, 08:09 AM   #10
dipenchaudhary
Member
 
Registered: Jan 2006
Location: india
Distribution: FEDORA CORE 3
Posts: 103

Rep: Reputation: 15
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....
 
Old 02-10-2006, 08:11 AM   #11
dipenchaudhary
Member
 
Registered: Jan 2006
Location: india
Distribution: FEDORA CORE 3
Posts: 103

Rep: Reputation: 15
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
 
Old 02-10-2006, 07:10 PM   #12
trojen
LQ Newbie
 
Registered: Feb 2006
Posts: 2

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

thanks for that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inetrnet connection sharing between a Slackware box and windows box planetsheinker Slackware 10 09-24-2006 12:53 AM
Sharing internet access with my Windows box ColdDeath Slackware 5 11-02-2005 04:08 PM
Why my Internet Sharing with Xp box not working? qutub110 Linux - Networking 4 04-19-2005 01:35 PM
Linux Box with 3 NICs for Internet sharing digihall7 Linux - Networking 3 04-30-2004 04:30 AM
Sharing Internet with a WinXP Box sovietpower Linux - Networking 2 11-13-2003 09:19 PM


All times are GMT -5. The time now is 01:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration