Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

iptables - nur SSH durchlassen

Empfohlene Antworten

Veröffentlicht

Hallo,

damit ich meine Linux Kenntnisse etwas erweitern und verbessern kann, habe ich mir 3 Linux-Systeme aufgesetzt und spiele dabei mit dem Netztwerk.

Ich hab die folgendermasen aufgebaut:

- Router -> zwei Netzwekkarten dient als router für Client1 und Client2

- Client1

- Cleint2

Das routing funkt wunder war und es gibt keine Probleme.

Jetzt wollt ich den Router so einstellen, dass nur noch SSH-Packete durchrutet:

1.) Alle Packete Blocken

2.) An erster Stelle werden alle Packe die von Port 22 kommen geblockt.

1.) iptables -A FORWARD -j DROP

2.) iptables -I FORWARD -p tcp --dport 22 -j ACCEPT
Die iptables Einstellungen habe ich natürlich auf dem Router vorgenommen. Wenn ich jetzt von Client1 über SSH auf Client2 zugreifen möchte, dann komme ich da überhaupt nicht durch. Hat jemand eine Ahnung was ich falsch mache? Hier noch den iptables -L - Stauts
iptables -L

Chain INPUT (policy ACCEPT)

target     prot opt source               destination


Chain FORWARD (policy ACCEPT)

target     prot opt source               destination

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh

DROP       0    --  anywhere             anywhere


Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination

Hi,

super jetzt hat es gefunzt :) DANKE.

  • 1 Monat später...

Hallo,

kenne mich mit iptables gar nicht aus und habe auch das Problem, dass ich mit Putty oder VNC nicht auf meine Ubuntu-Workstation komme.

Was muss ich wo und wie konfigurieren, damit es geht?

Habe das hier schon versucht:


Chain INPUT (policy ACCEPT)

target     prot opt source               destination         

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh 


Chain FORWARD (policy ACCEPT)

target     prot opt source               destination         

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh 


Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination         

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh 

Geht aber trotzdem nicht mit dem Putty... :( 2. Habe das noch gemacht, weiß aber nicht was ich damit angestellt habe:

Chain INPUT (policy ACCEPT)

target     prot opt source               destination         

ACCEPT     tcp  --  anywhere             anywhere            tcp spt:ssh 

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh 


Chain FORWARD (policy ACCEPT)

target     prot opt source               destination         

ACCEPT     tcp  --  anywhere             anywhere            tcp spt:ssh 

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh 


Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination         

ACCEPT     tcp  --  anywhere             anywhere            tcp spt:ssh 

ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh 

Geht auch nicht...

Vielen Dank.

Gruß

Der Dude

Ich fahre ja hiermit sehr gut.

Wobei auch das nicht die 100% Lösung ist, da ich immernoch jeglichen ausgehenden Traffic zu lasse.

Vielleicht sollte ich da eine entsprechende Regel nochmal einpflanzen.

Was ich mich frage, warum ist eure Policy für die jeweilige Tabelle auf ACCEPT?

#!/bin/sh


LOOPBACK_IF=lo

IP_ADD_lo=127.0.0.1

IP_ADD=XX.XX.XX.XX

PRIV=0:1023

UNPRIV=1024:65525


iptables -F INPUT

iptables -F FORWARD

iptables -F OUTPUT


iptables -P INPUT DROP

iptables -P FORWARD DROP

iptables -P OUTPUT ACCEPT


# loopback

# iptables -A INPUT -i $LOOPBACK_IF -j ACCEPT


# ssh_server

iptables -A INPUT -p tcp --dport 22 -d $IP_ADD --sport $UNPRIV -j ACCEPT

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.