iptables routing über ippp0

  • Themenstarter Themenstarter antcool
  • Beginndatum Beginndatum
A

antcool

Guest
Ich weiß das wenn ich google an machen und das suche finde ich Tonnen, aber
wenn ich genau das mache was dort steht geht es nicht.

Ich will nur bestimmte PCs anhand der MAC-Adresse und per iptables in das internet routen über ippp0.

Ich hatte mir das zu ein Script gemacht, aber wenn ich die Variablen def. für
PC1=AA:BB:CC:DD:00:11 z.B.

und diese später bei iptables einfüge sagt er mir einen Fehler.

Kann mir jemand mal so ein Script posten
 
Um etwas genauer zu werden:

#!/bin/bash
case "$1" in

start)
echo "Starte Firewall..."

LIMI=00:04:61:4D:41:6D

modprobe ip_tables
modprobe iptable_filter
modprobe ip_conntrack
modprobe ipt_MASQUERADE
echo 1 >> /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -X
iptables -nat -F
iptables -t nat -X
iptables -A FORWARD -t filter -s $LIMI -j ACCEPT
iptables -t nat -A POSTROUTING -o ippp0 -s $LIMI -j MASQUERADE
;;
stop)
echo "Beende Firewall..."
iptables -F
iptables -X
iptables -nat -F
iptables -t nat -X
;;
*)
echo "Ursache: $0 {start|stop}"

exit 1
esac

und der Fehler:
[root@limi rmichel]# ./firewall start
Starte Firewall...
iptables v1.2.7a: Unknown arg `iptables'
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.2.7a: host/network `00:04:61:4D:41:6D' not found
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.2.7a: host/network `00:04:61:4D:41:6D' not found
Try `iptables -h' or 'iptables --help' for more information.
 
doch noch ne fehlermeldung gepostet...muste nichtmal nachfragen

"-s" ist wohl der falsch parameter.....

http://iptables-tutorial.frozentux.net/other/iptables.html#lbAO
-s, --source [!] address[/mask]
Source specification. Address can be either a hostname, a network name, or a plain IP address. The mask can be either a network mask or a plain number, specifying the number of 1's at the left side of the network mask. Thus, a mask of 24 is equivalent to 255.255.255.0. A "!" argument before the address specification inverts the sense of the address. The flag --src is a convenient alias for this option.
......
--mac-source [!] address
Match source MAC address. It must be of the form XX:XX:XX:XX:XX:XX. Note that this only makes sense for packets entering the PREROUTING, FORWARD or INPUT chains for packets coming from an ethernet device.
 
Zurück
Oben