LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 07-27-2003, 01:57 PM   #1
SolidSnake
Member
 
Registered: Jul 2003
Location: UK,London
Distribution: White Box Enterprise Linux 3
Posts: 83

Rep: Reputation: 15
Internet connection sharing and dhcp


Hello
Today i installed redhat linux because I lost my windows 2000 cd when i was moving. So far i think linux Is great. But now i need to share my internet connection to windows xp computers. So can any 1 help me setup DHCP and interenet connection sharing on redhat 9?

P.S I'm a newbie to linux so please can you say it in easy word.
 
Old 07-27-2003, 02:12 PM   #2
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
How many windowsXP computers do you have ?
It may be easier to set them up with Static IPs.

To setup Internet connection sharing in RedHat, you can use the GUI tools located under System in the menu.
Or you can do it manually.
 
Old 07-27-2003, 02:18 PM   #3
SolidSnake
Member
 
Registered: Jul 2003
Location: UK,London
Distribution: White Box Enterprise Linux 3
Posts: 83

Original Poster
Rep: Reputation: 15
I know this is a stupid question but where do i go in the menu and I have got 5 computers and thanks for your reply
 
Old 07-27-2003, 02:43 PM   #4
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Since you have 5 computers, it would be easier to give them static IPs.
But if you want to setup DHCP, take a look at the RedHat HowTO.
http://www.redhat.com/docs/manuals/l...e/ch-dhcp.html

To access administration tools, go to the Main Menu Button (on the Panel) => System Settings.
I don't remember if RedHat has an Internet Connection Sharing wizard.

If you can't find it, I can tell you how to set it up manually.
I will need to know if your Linux has two network cards
or are you using a router ?
Network Layout ?


RedHat 9 Documentation
http://www.redhat.com/docs/manuals/linux/
 
Old 07-27-2003, 02:54 PM   #5
SolidSnake
Member
 
Registered: Jul 2003
Location: UK,London
Distribution: White Box Enterprise Linux 3
Posts: 83

Original Poster
Rep: Reputation: 15
thanks for your relpy. sorry i cant find the administration tools. I have got two NIC cards installed and connected. all my computers are connected using a 5-port switch. ANd i have given all my computers static ip address from 192.168.0.5-192.168.0.10
 
Old 07-27-2003, 03:09 PM   #6
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Well if you want to get started have a look at this thread and cough...my post in their which is red hat 'centric

http://www.linuxquestions.org/questi...ght=GATEWAYDEV

I'm no iptables demon myself but it'll get you going 'till the pro's come along

Have to change ip's to 192.168.0.0 probably and the gateway dev to the appropriate one
 
Old 07-27-2003, 03:15 PM   #7
SolidSnake
Member
 
Registered: Jul 2003
Location: UK,London
Distribution: White Box Enterprise Linux 3
Posts: 83

Original Poster
Rep: Reputation: 15
isnt that for DHCP?
 
Old 07-27-2003, 03:35 PM   #8
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
What version of RedHat are you using ?

Manual Setup

Edit the file /etc/sysctl.conf and on the line net.ipv4.ip_forward = 0, change 0 to 1.
Code:
# Controls IP packet forwarding
net.ipv4.ip_forward = 1
Now you need to setup IP forwarding and Masquerading.
First, you need to flush the old rules.
So open a console window and at the command line, type:
Code:
iptables -F INPUT
iptables -F OUTPUT
iptables -F FORWARD
iptables -t nat -F
The following commands will create new rules for your system.
Code:
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP

iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
iptables -A FORWARD -j LOG

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
NOTE: In this case, eth0 connects to the internet and eth1 connects to the local network.
You may need to switch eth0 and eth1.
The ifconfig command will give you more information.

To save iptables modifications, at the command line, type service iptables save.
IPtable rules are located in the /etc/sysconfig/iptables file.
 
Old 07-27-2003, 04:17 PM   #9
SolidSnake
Member
 
Registered: Jul 2003
Location: UK,London
Distribution: White Box Enterprise Linux 3
Posts: 83

Original Poster
Rep: Reputation: 15
should internet work on the other computers after doing this because it doesnt
 
Old 07-27-2003, 05:47 PM   #10
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Can you ping your Linux system from a winXP system?
Can you surf the internet with Linux station?
 
Old 07-28-2003, 04:15 AM   #11
SolidSnake
Member
 
Registered: Jul 2003
Location: UK,London
Distribution: White Box Enterprise Linux 3
Posts: 83

Original Poster
Rep: Reputation: 15
yep i can ping linux from xp
 
Old 07-28-2003, 05:31 AM   #12
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Double check that iptables is on

do
/etc/init.d/iptables status

if all you get is output with rows of column headers with no rules underneath it isn't turned on. If you went throught the exact procedure above thus saving the rules

/etc/init.d/iptables start

then
chkconfig --level 35 iptables on
which turns them on automtically at boot

of course this only relates to if they're turned on or not nothing else

also assumes you've rebooted at some point and the tables have been flushed since you initially applied the rules

Last edited by Looking_Lost; 07-28-2003 at 05:34 AM.
 
Old 07-28-2003, 05:35 AM   #13
SolidSnake
Member
 
Registered: Jul 2003
Location: UK,London
Distribution: White Box Enterprise Linux 3
Posts: 83

Original Poster
Rep: Reputation: 15
IPtables was on and they start at boot up
 
Old 07-28-2003, 06:04 AM   #14
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Well if you aren't fed-up yet and want to try my way here it is

save the rules you've got just now
cp /etc/sysconfig/iptables /etc/sysconfig/iptables.old

do
iptables --flush

Assuming eth0 is device connected to internet

edit
/etc/syconfig/network (whatever the equivalent may be)

comment out gateway with a #
add
GATEWAYDEV=eth0

make sure ipv4_forward is enabled as above in redhat can edit (which you've already done)
/etc/sysctl.conf

iptables rules, you can cut,paste and enter them a line at a time into your shell to save typing errors:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
iptables -A FORWARD -d 192.168.0.0/24 -j ACCEPT
iptables -A FORWARD -s ! 192.168.0.0/24 - DROP

save them
iptables-save > /etc/sysconfig/iptables

restart network
/etc/init.d/network restart

restart iptables
/etc/init.d/iptables restart

if it don't help then just copy iptables.old back to iptables
comment out GATEWAYDEV
uncomment gateway
restart network
restart iptables

and hang in their
 
Old 07-28-2003, 06:14 AM   #15
SolidSnake
Member
 
Registered: Jul 2003
Location: UK,London
Distribution: White Box Enterprise Linux 3
Posts: 83

Original Poster
Rep: Reputation: 15
i dont know what my equivalent to /etc/syconfig/network is
 
  


Reply



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
trying to setup linux firewal/dhcp server but its not sharing the internet connection abefroman Linux - Networking 4 05-01-2005 04:39 AM
Internet Sharing w/o DHCP Server Mookid77 Mandriva 1 07-20-2004 07:18 AM
Internet sharing and dhcp trouble iceaway Mandriva 2 03-12-2004 03:50 PM
Internet Sharing with DHCP connection to the Net Earp Linux - Networking 1 06-15-2003 02:57 PM
Sharing internet between DHCP protocol? tr4nce Linux - Networking 10 03-25-2003 06:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:41 AM.

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