SSH Port iptables umleiten

Posted by DocX on Mai 16, 2008

Fürs Archiv:

$IPTABLES -t mangle -A PREROUTING -p tcp -m tcp –dport 2222 -j MARK –set-mark 0×8ae
$IPTABLES -t nat -A PREROUTING -d 1.2.3.4 -p tcp -m tcp –dport 2222 -j DNAT –to-destination 1.2.3.4:22
$IPTABLES -A INPUT -d 1.2.3.4-p tcp -m tcp –dport 22 -m mark –mark 0×8ae -j ACCEPT
$IPTABLES -A INPUT -d 1.2.3.4 -p tcp -m tcp –dport 22 -j DROP
$IPTABLES -A INPUT -d 1.2.3.4 -p tcp -m tcp –dport 2222 -j ACCEPT

  • Category: Privat |
  • Tags: ,
  • Meta: no comments, permalink, rss

Selbstnotiz für mich bezüglich Firewall-Rules perm in Sveasoft Satori Firmware adden

Posted by DocX on April 07, 2005

nvram set rc_firewall=’/usr/sbin/iptables -I FORWARD -s xxx.xxx.xxx.0/24 -d xx.xx.xx.0/24 -j DROP;/usr/sbin/iptables -I FORWARD -s xxx.xxx.xxx.0/24 -d xx.xx.xx.0/24 -j DROP;/usr/sbin/iptables -I FORWARD -s xxx.xxx.xxx.0/24 -d xx.xx.xx.0/24 -j DROP’

nvram commit

Continue reading…

  • Category: Blogging |
  • Tags: , , ,
  • Meta: no comments, permalink, rss

IP-Klau

Posted by DocX on Oktober 27, 2004

Im Wohnheim gibts ja immer wieder Leute die IP-Hijacking machen und dann umsonst surfen. Teilweise war das echt nervig. Da nicht im jedem Zimmer eine Dose ist die man patchen könnte, sondern nur eine zentrale in der Küche ist, mußte eine andere Lösung her. Eine Filterung auf MAC-Adresse und die dazu passende IP-Adresse.

Geht mit iptables so:

iptables -F
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
iptables -N block
iptables -A INPUT -j block
iptables -A FORWARD -j block
iptables -A block -s 10.0.0.1 -m mac –mac-source 00:00:00:00:00:00 -j ACCEPT

Continue reading…

  • Category: Privat |
  • Tags: , , , ,
  • Meta: no comments, permalink, rss