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.