Linuxathome.net

Linux news and help for home broadband internet users
It is currently Wed Oct 09, 2024 5:09 pm

All times are UTC + 10 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Aug 11, 2002 8:10 pm 
Offline
Newbie

Joined: Sun Aug 11, 2002 8:04 pm
Posts: 3
Hi people,

I have just followed the instructions from this website on how to setup Internet Connection Sharing on my Linux box. I am running Red Hat Linux 7.2 (KDE). I have followed the steps on how to edit the rc.firewall file.

I cannot get the script to run during startup. However when I manually execute the file, Internet sharing works great. My XP and 2000 Pro machine can access the Internet fine. How do I get the script to run automatically?

I added the line "./rc.firewall" to the file rc.local and rebooted. Nothing worked.

Please help.

Regards,
tliong

totoliong@optushome.com.au


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 12, 2002 1:03 am 
Offline
Admin

Joined: Sun Jun 23, 2002 9:20 pm
Posts: 187
Location: Interweb - Sydney
You need to make sure that the rc.firewall script is in the same direction as the rc.local you have edited to call it from..

Otherwise you need to give the full path information e.g. if your rc.firewall is in /home/username/ then you will need to put /home/username/rc.firewall instead of ./rc.firewall

Basically ./<blah> means run the program located in the SAME directory as the current one your in.

Hope this helps :)

_________________
"Backups are for wimps. Real men upload their data to an FTP site and have everyone else mirror it."
Administrator, Editor, Technical
http://www.linuxathome.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 12, 2002 4:37 pm 
Offline
Newbie

Joined: Sun Aug 11, 2002 8:04 pm
Posts: 3
Hi mayhem,

Thanx for the info. I still can't seem to get the script to run on startup.

I am in the /etc/rc.d folder logged on as #root

I type in:

pico rc.local

The following is presented:

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

After putting one space after the line "touch /var/lock/subsys/local", I type in:

./rc.firewall

So, the rc.local file looks like this:

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

./rc.firewall

I reboot. Still no go.

However, when I'm in the directory /etc/rc.d and type the following command it works:

./rc.firewall

NOTE: The rc.firewall and rc.local files are located in the /etc/rc.d directory.

My rc.firewall file looks like this:

#!/bin/sh
# DHCP Internet and Connection Sharing Script
# Coded by Mayhem (C)2000

# Net Sharing
echo '1' > /proc/sys/net/ipv4/ip_forward
/sbin/ipchains -A input -j ACCEPT -i eth0 -s 0/0 67 -d 0/0 68 -p udp
/sbin/ipchains -P forward DENY
/sbin/ipchains -A forward -s 192.168.0.0/24 -j MASQ

NOTE: I did not enter the #DHCP code, as my connection to O@H seems to be ok. O@H is allocating the correct IP address for me and I can browse without any issues.

What am I doing wrong? HELP!

I am running RH 7.2 KDE 2.2.1

Thanks for any help you can provide.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 12, 2002 5:37 pm 
Offline
Newbie

Joined: Sun Jun 30, 2002 10:51 am
Posts: 24
Location: /dev/null
Looks like rc.local isn't getting executed for some reason (I'm assuming it is chmod'd correctly). Try the following:

cd /etc/rc.d/
find . -name S99local


you should get an output like this:

./rc2.d/S99local
./rc3.d/S99local
./rc5.d/S99local

Make sure you are in runlevel 3 by typing runlevel

If all of the above looks OK, I dunno what's going on. Try replacing ./rc.firewall with the full path: /etc/rc.d/rc.firewall


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 12, 2002 10:38 pm 
Offline
Newbie

Joined: Sun Aug 11, 2002 8:04 pm
Posts: 3
Hi redlander,

The problem is finally resolved.

Here is what I did:

cd /etc/rc.d
chmod u+x rc.local

I then, edited the rc.local file and entered the following line at the end:

/etc/rc.d/rc.firewall

Either the "chmod" or the full path did the trick I guess. Anyways, ALL works fine and when I startup my Linux box, the pc's on my network (WinXP and 98) can browse the net!

BTW... I also typed in: find . -name S99local and the following output was shown:

./rc2.d/S99local
./rc3.d/S99local
./rc4.d/S99local
./rc5.d/S99local

I then typed in:

runlevel

It displayed:

N 5

Not too sure what this means, but anyways, problem is fixed.

THANKS!!!

Regards,

tliong.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Aug 13, 2002 11:53 am 
Offline
Admin

Joined: Sun Jun 23, 2002 9:20 pm
Posts: 187
Location: Interweb - Sydney
Glad you got it working...

The first things I always check when a script dies are:
- Permissions
- Path

Welcome to the Linux world... hope you enjoy your stay :)

_________________
"Backups are for wimps. Real men upload their data to an FTP site and have everyone else mirror it."
Administrator, Editor, Technical
http://www.linuxathome.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 10, 2002 11:40 pm 
Offline
Newbie

Joined: Sat Oct 05, 2002 7:26 am
Posts: 9
Mayhen,
I have finally got my linux machine connected to the net and xp box connected to the linux box.

But.
I am not able to get internet access from the xp box.

I am running Mandrake 9. Can I follow the same procedures to set up internet sharing?

_________________
Marty
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Oct 11, 2002 1:29 pm 
Offline
Admin

Joined: Sun Jun 23, 2002 9:20 pm
Posts: 187
Location: Interweb - Sydney
Yeah there shouldn't be a problem.

I recommend Firestarter if you dont want to get your hands dirty with IPTABLES directly :P

_________________
"Backups are for wimps. Real men upload their data to an FTP site and have everyone else mirror it."
Administrator, Editor, Technical
http://www.linuxathome.net


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 10 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group