ip routing wount work (this set-up worked fine on Debian thou)
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
ip routing wount work (this set-up worked fine on Debian thou)
Hi.
I have my windowsbox hooked up to linuxbox's eth1, and am trouting to turn linuxbox into a router. Now it worked fine before when i had debian. Right now my two computers can ping each other, however I cannot set up ip forwarding properly. The command /usr/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE seems to have no effect, as windowsbox is still offline. How are you supposed to set up ip routing in slack, after all?
note -- set up is:
internet -- eth0 -- linux -- eth1 -- windows netcard -- windows
It outputs a 1 character to that file, 1 means ON
/proc/sys/net/ipv4/ip_forward is not a program, it's a configuration of that process (take a look at the files under /proc and you'll understand what i mean).
Just incase you didnt know, that echo "1" command wont survive a reboot, so you will have to place that in some startup script. Or you can take my recommendation and get IPKungfu which is nothing more than a very robust and easy-to-configure iptables firewall that sets all these things for you. You can get IPKungfu at => www.linuxkungfu.org
If you decide to use it, here is the slackware startup script that I made for it.
Code:
#!/bin/sh
#
# ipkungfu startup script
#
# description: Starts the ipkungfu firewall
#
# by Rocco Stanzione, based on the iptables script:
# IPKungFu Author: Rocco Stanzione <grasshopper@linuxkungfu.org>
# Init Script Author: Sean Donner <siegex@identityflux.com>
IPKF_CONFIG=/etc/ipkungfu/ipkungfu.conf
IPKF_EXE=/usr/local/sbin/ipkungfu
if ! [ -x $IPKF_EXE ] ; then
echo $IPKF_EXE is not executable!
exit
fi
if ! [ -r $IPKF_CONFIG ] ; then
echo $IPKF_CONFIG cannot be read
exit
fi
KERNELMAJ=`uname -r | awk -F . '{print $1}'`
KERNELMIN=`uname -r | awk -F . '{print $2}'`
if [ "$KERNELMAJ" -lt 2 ] ; then
echo Kernel Major Number is less than 2
exit
elif [ "$KERNELMAJ" -ge 2 -a "$KERNELMIN" -lt 3 ] ; then
echo Kernel Minor Number is less than 3
exit
fi
lsmod 2>&1 /dev/null | grep -qi ipchains && echo "ipchains module loaded. Aborting. Try rmmod ipchains and try again."
start() {
echo -n "Starting ipkungfu: "
$IPKF_EXE --init && echo -e "\t\t\t\t\t\t[ OK ]" || echo -e "\t\t\t\t\t\t[ FAILED ]"
}
stop() {
$IPKF_EXE --disable
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
# "restart" is really just "start" as this isn't a daemon,
# and "start" clears any pre-defined rules anyway.
# This is really only here to make those who expect it happy
start
;;
status)
$IPKF_EXE --check
;;
panic)
$IPKF_EXE --panic
;;
*)
echo "Usage: $0 {start|stop|restart|status|panic}"
exit
esac
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.