LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-01-2004, 11:39 PM   #1
Lechium
Member
 
Registered: Jun 2004
Distribution: Gentoo
Posts: 102

Rep: Reputation: 16
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

thank you
 
Old 08-01-2004, 11:48 PM   #2
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Try before that: echo "1" > /proc/sys/net/ipv4/ip_forward
 
Old 08-01-2004, 11:51 PM   #3
Lechium
Member
 
Registered: Jun 2004
Distribution: Gentoo
Posts: 102

Original Poster
Rep: Reputation: 16
that worked. thanks!

btw I understand that it runs ip forwaring program, but why echo "1" < in front?
 
Old 08-01-2004, 11:56 PM   #4
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
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).

Last edited by gbonvehi; 08-02-2004 at 12:09 AM.
 
Old 08-02-2004, 12:25 AM   #5
Lechium
Member
 
Registered: Jun 2004
Distribution: Gentoo
Posts: 102

Original Poster
Rep: Reputation: 16
cool thanks
 
Old 08-02-2004, 01:16 AM   #6
SiegeX
Member
 
Registered: Jul 2004
Location: Silicon Valley, CA
Distribution: Slackware
Posts: 171

Rep: Reputation: 38
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
 
Old 08-02-2004, 11:46 AM   #7
Lechium
Member
 
Registered: Jun 2004
Distribution: Gentoo
Posts: 102

Original Poster
Rep: Reputation: 16
thanks!
 
  


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
Enemy Territory wount work witth different conf's.. k0ljat Linux - Games 0 08-28-2004 01:34 AM
cant get gui to work in RH9, but worked fine in mandrake 10 sgcam2000 Linux - Hardware 0 07-13-2004 05:28 AM
Sound worked fine during installation, but not after... Shekers Linux - Hardware 3 05-31-2004 06:16 PM
GNU autotools in Rh 9 broken? Worked fine in 7.3... rylan76 Red Hat 1 04-17-2004 02:27 PM
mouse wount work after rebooting bmlinuxuser Linux - Hardware 6 01-25-2003 01:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:54 AM.

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