Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IP MASQUERADING??

Status
Not open for further replies.

ServingSize1can

Technical User
May 21, 2002
15
0
0
US
How would I set up ipmasquerading on redhat 7.1 (kernal 2.4.2-2). I have two nics on my machine. eth1 has a public address and eth0 has 169.254.0.1 (private). I know that i have to edit the rc.local file but I don't know what to edit to it. Ive done some research and have tried to add some ipchain commands into this file but it did not work after a reboot.

This is what my rc.local files looks like:

#!/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.

if [ -f /etc/redhat-release ]; then
R=$(cat /etc/redhat-release)

arch=$(uname -m)
a="a"
case "_$arch" in
_a*) a="an";;
_i*) a="an";;
esac

NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
if [ "$NUMPROC" -gt "1" ]; then
SMP="$NUMPROC-processor "
if [ "$NUMPROC" = "8" -o "$NUMPROC" = "11" ]; then
a="an"
else
a="a"
fi
fi

# This will overwrite /etc/issue at every boot. So, make any changes you
# want to make to /etc/issue here or you will lose them when you reboot.
echo "" > /etc/issue
echo "$R" >> /etc/issue
echo "Kernel $(uname -r) on $a $SMP$(uname -m)" >> /etc/issue

cp -f /etc/issue /etc/issue.net
echo >> /etc/issue
fi
touch /var/lock/subsys/local
 
Just add :

echo "1" > /proc/sys/net/ipv4/ip_forward
ipchains -F
ipchains -A forward -p tcp -s 169.254.0.1/24 -j MASQ

that should give access for all machines at 169.254.0.1/24 to where ever they want to go. For further information, I suggest "man ipchains". ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top