LinuxQuestions.org
Review your favorite Linux distribution.
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 03-17-2007, 11:27 PM   #1
tanveer
Member
 
Registered: Feb 2004
Location: e@rth
Distribution: RHEL-3/4/5,Gloria,opensolaris
Posts: 525

Rep: Reputation: 39
linux user auto login and NAT


Hi all:

I have a PC in my home with winxp, rhel-3 installed on it. Now I used IP forwarding in my rhel so that my father can use my broadband connection.
Now the problem is:

I put the iptables script at the /etc/rc.d/rc.local and it also executes at boot but dont work until I login and executes the script again. though I gave permission of that script 777.
As my father is not that aware of linux stuff obviously so for him I want to make the login prompt automatic for this reason and then he has to run that script which is very tedious for him.

Waiting for your reply.
 
Old 03-18-2007, 02:44 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
you should have no need to add scripts anywhere. you should use the iptables service to control iptables rules, and enable ip forwarding via /etc/sysctl.conf
 
Old 03-19-2007, 02:21 AM   #3
tanveer
Member
 
Registered: Feb 2004
Location: e@rth
Distribution: RHEL-3/4/5,Gloria,opensolaris
Posts: 525

Original Poster
Rep: Reputation: 39
My linux box has 2 NIC one for internal 192.168.100.10 and one for external.
My other PC has IP 192.168.100.20 and can use internet though my pc.
I have this setup in my router linux box.
I have enable auto login by editing /etc/inittab but still after I have run the script to make 2nd pc use internet although its written in rc.local.

/etc/rc.d/rc.local file:-
-------------------------
Code:
#!/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 
/etc/rc.d/rc.ipmasq
/etc/rc.d/rc.ipmasq :-
----------------------
Code:
#!/bin/sh 
IPTABLES=/sbin/iptables 
$IPTABLES -F -t nat 
$IPTABLES -A POSTROUTING -t nat -o eth1 -j MASQUERADE 
echo 1 > /proc/sys/net/ipv4/ip_forward
I also used this command to make it executable
# chmod /etc/rc.d/rc.ipmasq
and then #/etc/rc.d/rc.ipmasq to enable network sharing.

Thanks in advance.
 
Old 03-19-2007, 03:19 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
ok, well my advice still stands...
 
Old 03-19-2007, 09:22 PM   #5
tanveer
Member
 
Registered: Feb 2004
Location: e@rth
Distribution: RHEL-3/4/5,Gloria,opensolaris
Posts: 525

Original Poster
Rep: Reputation: 39
OK, thanks.
One more thing, is there any way to know what IP is accessing my NAT, using how much bw, and anything about caching overflow on my NAT server if using a Large amount of user?

thanks.
 
Old 03-20-2007, 02:33 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well netstat / lsof will list open connections, if that's all you're after. what do you mean by caching overflow? squid poxying or something? that'd be at a different app specific level.
 
  


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
auto login as root (or other user) in console mode Peter_Peck Linux - General 4 05-01-2009 02:05 AM
Auto-login Without user and password hraposo Fedora 1 07-12-2006 07:15 AM
Auto Login User ImpactDNI Linux - Software 7 04-21-2005 03:28 PM
Auto login normal user debian a10392 Debian 3 01-14-2005 06:30 AM
Auto login default user? zebthepilot Linux - General 2 01-15-2003 04:46 PM

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

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