![](https://seccdn.libravatar.org/avatar/fcd83b7fb3d39062d24ac5b76b2b84f5.jpg?s=120&d=mm&r=g)
'tschuldigung, ich vergass: eth0 = linke Netz = 192.168.100.0/24 eth1 = TDSL = DoD = Internet eth2 = rechte Netz = 192.168.200.0/24 sorry, I've forgotten: eth0 = left net = 192.168.100.0/24 eth1 = TDSL = DoD = Internet eth2 = right net = 192.168.200.0/24
Hello Liste!
Erst in Deutsch... than follows my rough english )-)
Ich habe ein kleines Skript fuer mein Linux 7.1/7.2 fuer ipchains gehabt. Linux als Zugangsserver (ueber ISDN, DoD) fuer mehrere PC in mehreren Subnetzen. ==> bischen Routing und Forwarding - viel Maskierung und Filterung. Das mit dem Port oeffnen und schliessen hab ich nun schon auf iptables umgestellt (ich hoffe auch richtig). Ich komme auch von den entfernten PC auf Linux - Linux waehlt auch raus (jetzt TDSL)... aber es fehlt noch das Maskieren - denn auf dem PC kommt nichts an! Linux selber kann Internetten..
Wie ist die richtige Syntax, um mit iptables das Maskieren einzustellen (siehe ###im alten Skript)? Ich habs schon mit diversen Tips aus Listen und SMB/netfilter versucht: z. B. iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE ...aber funzt irgendwie nicht.
Oder wer kann mir "eine" Zeile sagen, mit der ich ohne die weiteren Filter mit den Subnetzen ins Internet komme? ...oder moeglichereise das alte Script uebersetzen?
mein altes Skript steht am Ende... Danke im Voraus!!!
******************* For the ENGLISCH
My script under Linux 7.1/7.2 with ipchains was good. My Linux was server for internet access with ISDN and dial on demand. ==> I have to do filtering - routing - forwarding and masquerading. To open or close a port with iptables is changed and good (I hope). My net find Linux - Linux is dialing (now TDSL) an get connected. But... nothing from the internet reaches my home-net - I must have masquerading. The Linux-Machine itself can go out to the internet.
What's the syntax for iptables and masquerading (see the old script ###). I've tried many tips out of lists... but nothing is right. e.g. iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE ... but nothing happend.
Or could you tell me "one" line to go with my net without filtering to the internet? ... proberly you can completely change my script from ipchains to iptables?
Thanks!
now the Script:
***snip*** #! /bin/bash
. /etc/rc.config
ipchains -F ipchains -X
case "$1" in start) echo -n "Starting Masquerading:" echo "1" > /proc/sys/net/ipv4/ip_forward modprobe ip_masq_user modprobe ip_masq_ftp
ipchains -A input -d 0/0 1025:65535 -p tcp -j ACCEPT ipchains -A input -d 0/0 1025:65535 -p udp -j ACCEPT
ipchains -A input -d 0/0 http -p tcp -j ACCEPT ipchains -A input -d 0/0 http -p udp -j ACCEPT
ipchains -A input -d 0/0 https -p tcp -j ACCEPT ipchains -A input -d 0/0 https -p udp -j ACCEPT
ipchains -A input -d 0/0 smtp -p tcp -j ACCEPT ipchains -A input -d 0/0 smtp -p udp -j ACCEPT
ipchains -A input -d 0/0 pop3 -p tcp -j ACCEPT ipchains -A input -d 0/0 pop3 -p udp -j ACCEPT
ipchains -A input -d 0/0 domain -p tcp -j ACCEPT ipchains -A input -d 0/0 domain -p udp -j ACCEPT
ipchains -A input -d 0/0 ftp-data -p tcp -j ACCEPT ipchains -A input -d 0/0 ftp-data -p udp -j ACCEPT ipchains -A input -d 0/0 ftp -p tcp -j ACCEPT
ipchains -A input -s 192.168.0.0/24 -d 0/0 netbios-ns -p tcp -j ACCEPT ipchains -A input -s 192.168.0.0/24 -d 0/0 netbios-ns -p udp -j ACCEPT ipchains -A input -s 192.168.0.0/24 -d 0/0 netbios-dgm -p tcp -j ACCEPT ipchains -A input -s 192.168.0.0/24 -d 0/0 netbios-dgm -p udp -j ACCEPT ipchains -A input -s 192.168.0.0/24 -d 0/0 netbios-ssn -p tcp -j ACCEPT ipchains -A input -s 192.168.0.0/24 -d 0/0 netbios-ssn -p udp -j ACCEPT
ipchains -A input -d 0/0 -p tcp -j REJECT ipchains -A input -d 0/0 -p udp -j REJECT
### ipchains -A forward -s 192.168.66.0/24 -d 0/0 -i ippp0 -j MASQ
echo -e "$rc_done"; ;; stop) echo -n "Stopping Masquerading:" rmmod ip_masq_user rmmod ip_masq_ftp echo "0" > /proc/sys/net/ipv4/ip_forward echo -e "$rc_done"; ;; restart) /sbin/init.d/masquerading stop /sbin/init.d/masquerading start ;; *) echo "Usage: masquerading {start|stop}" exit 1 ;; esac ***end snip***
- - - - - - - - - - - - - - - - PHICUS - Peter Hoehne Informationssysteme URL: http://www.phicus.de Computer und Software Geschaeft: 0171/4929507 Steinkamp 48 Fax: 05303/6973 38179 Schwuelper Privat: 05303/6852 Germany E-Mail:
-- To unsubscribe, e-mail: suse-security-unsubscribe@suse.com For additional commands, e-mail: suse-security-help@suse.com
- - - - - - - - - - - - - - - -
PHICUS - Peter Hoehne
Informationssysteme URL: http://www.phicus.de
Computer und Software Geschaeft: 0171/4929507
Steinkamp 48 Fax: 05303/6973
38179 Schwuelper Privat: 05303/6852
Germany E-Mail:
participants (1)
-
Hoehne_Peter@t-online.de