← Back to team overview

sslug-teknik team mailing list archive

Re: [TEKNIK] Linux som router mellem ppp og win pc.

 

Hello Dennis,

mandag, 5. april 1999, you wrote:

DL> Er der nogen der ved hvad der skal til få at få ip-forwarding til at
DL> virke under 2.2.1???
Du skal bruge IPChain.

Du kan evt. bruge følgende script. Det bruger jeg til at gå på nettet
igennem en 2.2.x maskine.

Du skal lige rette det til så det
passer med dine IP numre (hvis du ikke lige kan se hvordan det skal
gøres, så skriv igen).

#!/bin/sh
# Note :
# This script will kill all current connections so use with care!
# IP spoofing protection!

# This is the best method: turn on Source Address Verification and get
# spoof protection on all current and future interfaces.
  if [ -e /proc/sys/net/ipv4/conf/all/rp_filter ]; then
    echo -n "Setting up IP spoofing protection..."
    for f in /proc/sys/net/ipv4/conf/*/rp_filter; do
        echo 1 > $f
    done
    echo "done."
  else
    echo PROBLEMS SETTING UP IP SPOOFING PROTECTION.  BE WORRIED.
    echo "CONTROL-D will exit from this shell and continue system startup."
    echo
    # Start a single user shell on the console
    /sbin/sulogin $CONSOLE
fi

# div. moduler

/sbin/modprobe ip_masq_cuseeme
/sbin/modprobe ip_masq_quake
/sbin/modprobe ip_masq_irc
/sbin/modprobe ip_masq_ftp
/sbin/modprobe ip_masq_raudio
/sbin/modprobe ip_masq_vdolive

# initialisere firewall
# Default accepter IKKE !
/sbin/ipchains -P input DENY

# Accepter alt paa alle ethernet kort.
/sbin/ipchains -A input -i eth+ -j ACCEPT
/sbin/ipchains -A input -i lo -j ACCEPT

# Næste linie er måske ikke helt 100% sikker, men ellers kunne jeg
# ikke lige få det til at virke..
/sbin/ipchains -A input -i ppp+ -j ACCEPT

# Sikkerhed!
/sbin/ipchains -A input -i ppp+ -s 10.10.10.0/24 -l -j DENY

# Her kan du så sætte op hvilke maskiner der må kommer på nettet.
# Hostnavnene (f.eks. pii.dn) kan udskiftes med en IP addr.
/sbin/ipchains -A forward -j MASQ -s workstation.dn/32 -d 0.0.0.0/0
/sbin/ipchains -A forward -j MASQ -s pii.dn/32         -d 0.0.0.0/0

# lidt statistik, saa jeg kan se mine og andres forbrug
/sbin/ipchains -A input -s workstation.dn
/sbin/ipchains -A input -s tine.dn

# Start the kernel forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward




Best regards,
 Simon




References