LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-06-2003, 11:40 AM   #1
N52
LQ Newbie
 
Registered: Jun 2003
Posts: 7

Rep: Reputation: 0
Can't figure out how to share internet connection in Red Hat 7.3


I just started using Linux about a week ago. I want to share my dial up internet connection, but haven't been able to figure out how to do it. I'm using Red Hat 7.3. Any help would be appreciated.
 
Old 06-06-2003, 01:45 PM   #2
je_fro
Member
 
Registered: Nov 2002
Location: /texas/austin/home/desk
Distribution: Gentoo
Posts: 341

Rep: Reputation: 30
Hmm...

I'm definately going to need LOTS more info....
What's the gateway? Which firewall? Lokkit?
Too many questions to list.....
 
Old 06-06-2003, 01:50 PM   #3
N52
LQ Newbie
 
Registered: Jun 2003
Posts: 7

Original Poster
Rep: Reputation: 0
The linux machine is the gateway, no firewall (at least that I know of, I never set one up on it). I have no idea what Lokkit is. If you could even give me an idea where to go to start configuring the share I coud probably get it working. I just have no idea where to start.
 
Old 06-06-2003, 01:56 PM   #4
je_fro
Member
 
Registered: Nov 2002
Location: /texas/austin/home/desk
Distribution: Gentoo
Posts: 341

Rep: Reputation: 30
So...

You have a modem and an ethernet cart in the gateway?
If so, try the network configuration tool. You'll have devices listed - a modem and eth0. Give the eth0 the IP 192.168.0.1, broadcast 192.168.0.255, netmask 255.255.255.0. The internal computer should (possibly) be setup with IP 192.168.0.2, etc...
That's a place to start....

Also, do this:
/sbin/iptables -L

and post the output back here...

Last edited by je_fro; 06-06-2003 at 01:58 PM.
 
Old 06-06-2003, 02:01 PM   #5
N52
LQ Newbie
 
Registered: Jun 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks. I'm trying that right now. I'll post again if I need more help.
 
Old 06-06-2003, 02:11 PM   #6
N52
LQ Newbie
 
Registered: Jun 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Here's the output I got from /sbin/iptables -L

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
 
Old 06-06-2003, 02:20 PM   #7
je_fro
Member
 
Registered: Nov 2002
Location: /texas/austin/home/desk
Distribution: Gentoo
Posts: 341

Rep: Reputation: 30
Ouch!!!!!

You're running NAKED!!!!!
Better get some clothes on...
Try this: http://iptables.1go.dk
Also this: http://www.netfilter.org/documentati...-tutorial.html
To do connection sharing you'll need ipmasquerade.

Here's a simple script to get you started. This stuff is intimidating at first, but it's really easy. You just need to read and learn.


#!/bin/sh
echo -e "\n\nLoading simple rc.firewall."
IPTABLES=/sbin/iptables
EXTIF="ppp0" #or whatever modem is...
INTIF="eth0"
echo " External Interface: $EXTIF"
echo " Internal Interface: $INTIF"
echo -en " Loading Modules: "
echo " -Verifying all kernel modules are OK"
/sbin/depmod -a
echo "Enabling Forwarding..."
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
echo " clearing any existing rules and setting default policy.."
$IPTABLES -P INPUT DROP ##changed from accept
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT DROP ##changed from accept
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD DROP
$IPTABLES -F FORWARD
$IPTABLES -t nat -F
echo " FWD: Allow all connections OUT and only existing and related ones IN"
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
$IPTABLES -A FORWARD -j LOG
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
#below here is new. above works.
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all
echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
$IPTABLES -A FORWARD -s ! 192.168.0.2 -j DROP
$IPTABLES -A INPUT -p ALL -i $INTIF -s 192.168.0.2 -j ACCEPT
$IPTABLES -A INPUT -p ALL -i lo -s 127.0.0.1 -j ACCEPT
$IPTABLES -A INPUT -p ALL -i $INTIF -d 192.168.0.255 -j ACCEPT
$IPTABLES -A INPUT -p ALL -i $EXTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A OUTPUT -p ALL -s 127.0.0.1 -j ACCEPT
$IPTABLES -A OUTPUT -p ALL -o $INTIF -j ACCEPT
$IPTABLES -A OUTPUT -p ALL -o $EXTIF -j ACCEPT
echo " Done loading rules."


Copy this and save it somewhere as: rc.firewall
then as su do: chmod 755 rc.firewall

sh rc.firewall

That should give you some protection temporarily....

Last edited by je_fro; 06-06-2003 at 02:24 PM.
 
Old 06-06-2003, 02:29 PM   #8
N52
LQ Newbie
 
Registered: Jun 2003
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks. I'll let you know how it works.
 
  


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
No internet connection in Red Hat.... rrfish72 Linux - General 1 12-04-2004 07:12 AM
No internet connection in Red Hat rrfish72 Linux - Networking 2 11-27-2004 03:56 PM
Red Hat internet share problem ethernet4 Linux - Networking 0 08-28-2004 10:12 AM
No internet connection in Red Hat 9 on VMware Sean Paul Linux - General 1 06-14-2004 10:44 AM
Red Hat 9 internet connection pashiewashie Linux - Newbie 3 05-01-2004 04:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:10 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