LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   linux user auto login and NAT (https://www.linuxquestions.org/questions/linux-networking-3/linux-user-auto-login-and-nat-538417/)

tanveer 03-17-2007 11:27 PM

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.

acid_kewpie 03-18-2007 02:44 PM

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

tanveer 03-19-2007 02:21 AM

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.

acid_kewpie 03-19-2007 03:19 AM

ok, well my advice still stands...

tanveer 03-19-2007 09:22 PM

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.

acid_kewpie 03-20-2007 02:33 AM

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.


All times are GMT -5. The time now is 03:35 AM.