LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-10-2006, 09:09 AM   #1
parthbakshi
LQ Newbie
 
Registered: Feb 2005
Location: India
Distribution: Suse linux 10.0
Posts: 28

Rep: Reputation: 15
sharing internet connection in linux


hi
I want to share my internet connection in linux with windows xp computers ,how am i suppose to do it ,i use suse linux 10.0
 
Old 03-10-2006, 10:06 AM   #2
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
You'll have to make your Linux box a "proxy" of sorts. You can use iptables to provide NAT for the XP boxes. Do a search on this forum for "Internet Connection sharing" and see if you get any useful info. I found a good thread here so I imagine similar threads should exist on this forum.

EDIT: Better yet, if you look in the SuSe forum here, you might find the best answer.

Good luck!

Peace...
 
Old 03-10-2006, 11:31 AM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
OK lets say you have the windows box connected to eth0
so first allow the connection through your firewall
$IPTABLES -A INPUT -i eth0 -j ACCEPT
then just make a seperate boot script called something like ipmasq and in it or add this to the bottom of you firewll script put
this assumes dialup ppp0 so adjust too your setup
Code:
#!/bin/bash

echo "setting up IPmasquerading......"

IPTABLES='/sbin/iptables'

#All The lines below are NAT routing

# flush any old rules
$IPTABLES -F -t nat

# turn on NAT (IP masquerading for outgoing packets)
$IPTABLES -A POSTROUTING -t nat -o ppp0 -j MASQUERADE

# enable IP forwarding (of incoming packets)
echo 1 > /proc/sys/net/ipv4/ip_forward
and set the address to the Linux box in windows as the default route and there you go
 
Old 03-10-2006, 12:26 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683
The ip-tables script given above may not be a good idea. By flushing your tables, you will loose your firewall. You can set the routing table and enable ip_forwarding in YaST. You will want to read the SuSE documentation on how you should enable masquerading in SuSE. This also goes by the name NAT (Network Address Translation). YaST has a section on routing, which you can also reach from the interface setup (Bottom part of the screen). Masquerading is enabled in the SuSE Firewall section of YaST. Of course, read through the relevent sections of the SuSE documentation. You can click on the help (lifesaver) icon, and search for masquerading and routing. When setting up masquerading, also set up the firewall. This is very important.

We have been assuming that the Linux computer is the one connected to the internet. If this is the case, be sure that the inside facing ethernet interface's (nic card) IP address is used as the Default Gateway when setting up XP. Otherwise be sure to set the default gateway address on the linux box to the inside XP address and enable network sharing in XP.

It would be much better to use the Linux computer to interface with the internet. This is because malware is more likely to target XP then linux, and these programs know how to turn of the XP's firewall.

Last edited by jschiwal; 03-10-2006 at 12:38 PM.
 
Old 03-10-2006, 02:52 PM   #5
scottmorris
Novell CoolSolutions Editor
 
Registered: Jan 2006
Distribution: SUSE 9.3 - 10.0
Posts: 30

Rep: Reputation: 16
Try this article.

I have written an article on how to share your Internet connection. It is available from the Novell CoolSolutions website.
 
Old 03-10-2006, 06:19 PM   #6
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
Quote:
Originally Posted by jschiwal
The ip-tables script given above may not be a good idea. By flushing your tables, you will loose your firewall.
nope sorry -- not true

-F flag flushes only the selected chain in the selected table

i put no chain designation so the command flushes all the chains in the nat table.
please note the (-t nat) at the end of the command.

this stuff aint rocket science
read
man iptables

why people need a gui program to do this kind of stuff is a mystery.

Last edited by foo_bar_foo; 03-10-2006 at 06:21 PM.
 
Old 03-10-2006, 07:35 PM   #7
tomdkat
Member
 
Registered: May 2003
Location: S.F. Bay Area
Distribution: Ubuntu 9.04 AMD64
Posts: 595

Rep: Reputation: 30
Quote:
Originally Posted by foo_bar_foo
why people need a gui program to do this kind of stuff is a mystery.
I think it's more of a comfort thing.

I'm not opposed to doing this kind of stuff at the command line but if there was a GUI I could use, I would probably use it.

Peace...
 
  


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
Linux internet sharing connection with XP des33 Linux - Networking 2 03-10-2005 07:05 AM
linux internet connection sharing usa1234 Linux - Networking 3 10-29-2004 11:27 AM
Internet Connection Sharing LINUX Please HELP MistroTHX Linux - Networking 2 10-06-2003 03:50 PM
Sharing Internet connection via Linux 8.0 troyzeng Linux - Networking 1 09-20-2003 02:41 PM
Internet connection sharing between XP and linux kidicarus Linux - Networking 16 09-16-2003 07:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:35 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
Open Source Consulting | Domain Registration