Skip to content

Wichtig Netzwerkbefehle

Linux
1 1 105
  • Wenn man Server aufsetzt und Domainnamen zuweisen muss, kommt man immer wieder in Verlegenheit verschiedene Netzwerkeigenschaften zu testen. Das hier sollte jeder von Euch kennen.

    ping 8.8.8.8
    ping www.google.com
    

    Gibt uns so was zurück

    frank@frank-MS-7C37:~$ ping 8.8.8.8
    PING 8.8.8.8 (8.8.8.8) 56(84) Bytes Daten.
    64 Bytes von 8.8.8.8: icmp_seq=1 ttl=113 Zeit=19.1 ms
    64 Bytes von 8.8.8.8: icmp_seq=2 ttl=113 Zeit=18.7 ms
    64 Bytes von 8.8.8.8: icmp_seq=3 ttl=113 Zeit=16.9 ms
    ^C
    --- 8.8.8.8 ping statistics ---
    3 Pakete übertragen, 3 empfangen, 0% Paketverlust, Zeit 2002ms
    rtt min/avg/max/mdev = 16.936/18.249/19.122/0.945 ms
    

    Nun wissen wir, das an der angegebenen IP ein Server antwortet. Das selbe mit IPv6

    frank@frank-MS-7C37:~$ ping 2001:4860:4860::8888
    PING 2001:4860:4860::8888(2001:4860:4860::8888) 56 Datenbytes
    64 Bytes von 2001:4860:4860::8888: icmp_seq=1 ttl=114 Zeit=20.1 ms
    64 Bytes von 2001:4860:4860::8888: icmp_seq=2 ttl=114 Zeit=18.7 ms
    64 Bytes von 2001:4860:4860::8888: icmp_seq=3 ttl=114 Zeit=15.9 ms
    ^C
    --- 2001:4860:4860::8888 ping statistics ---
    3 Pakete übertragen, 3 empfangen, 0% Paketverlust, Zeit 2002ms
    rtt min/avg/max/mdev = 15.872/18.207/20.063/1.744 ms
    

    Jetzt kommt es vor, das man den Domainnamen umgestellt hat, die Änderung im Internet aber etwas dauert. Wenn man schauen will, auf welchen Server der Domainname verweist, macht man folgendes.

    frank@frank-MS-7C37:~$ dig forum.frank-mankel.org
    
    ; <<>> DiG 9.16.1-Ubuntu <<>> forum.frank-mankel.org
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37120
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 65494
    ;; QUESTION SECTION:
    ;forum.frank-mankel.org.		IN	A
    
    ;; ANSWER SECTION:
    forum.frank-mankel.org.	208	IN	A	136.243.29.254
    
    ;; Query time: 0 msec
    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    ;; WHEN: Fr Sep 24 19:57:18 CEST 2021
    ;; MSG SIZE  rcvd: 67
    

    Wichtig ist das hier

        ;; ANSWER SECTION:
        forum.frank-mankel.org.	208	IN	A	136.243.29.254
    

    Das zeigt uns, auf welchen Server der Domainname verweist. Nun mal mit IPv6

    frank@frank-MS-7C37:~$ dig forum.frank-mankel.org AAAA
    
    ; <<>> DiG 9.16.1-Ubuntu <<>> forum.frank-mankel.org AAAA
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29154
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 65494
    ;; QUESTION SECTION:
    ;forum.frank-mankel.org.		IN	AAAA
    
    ;; ANSWER SECTION:
    forum.frank-mankel.org.	600	IN	AAAA	2a01:4f8:160:5339::254
    
    ;; Query time: 40 msec
    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    ;; WHEN: Fr Sep 24 20:01:06 CEST 2021
    ;; MSG SIZE  rcvd: 79
    

    Jetzt hat man manchmal eigene DNS-Server aufgesetzt und muss das kontrollieren, das geht so. Hier am Beispiel Google.

    frank@frank-MS-7C37:~$ dig @8.8.8.8 forum.frank-mankel.org
    
    ; <<>> DiG 9.16.1-Ubuntu <<>> @8.8.8.8 forum.frank-mankel.org
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 459
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 512
    ;; QUESTION SECTION:
    ;forum.frank-mankel.org.		IN	A
    
    ;; ANSWER SECTION:
    forum.frank-mankel.org.	600	IN	A	136.243.29.254
    
    ;; Query time: 24 msec
    ;; SERVER: 8.8.8.8#53(8.8.8.8)
    ;; WHEN: Fr Sep 24 20:03:17 CEST 2021
    ;; MSG SIZE  rcvd: 67
    

    Wichtig ist hier folgendes

    ;; SERVER: 8.8.8.8#53(8.8.8.8)
    

    zeigt uns, das die Anfrage von diesem Server beantwortet wurde. Alle anderen, siehe oben, wurden von diesem Server beantwortet.

    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    

    Was war noch wichtig, beim Erstellen meiner Server auf dem Proxmox 🤔 Ports sind noch ein wichtiges Thema. Dazu kann man nmap benutzen. Das scannt die angegebene Adresse nach offene Ports ab.

    root@webserver1-php:~# nmap 136.243.29.254
    Starting Nmap 7.80 ( https://nmap.org ) at 2021-09-24 20:15 CEST
    Nmap scan report for static.254.29.243.136.clients.your-server.de (136.243.29.254)
    Host is up (0.00018s latency).
    Not shown: 996 filtered ports
    PORT     STATE SERVICE
    22/tcp   open  ssh
    80/tcp   open  http
    443/tcp  open  https
    4567/tcp open  tram
    
    Nmap done: 1 IP address (1 host up) scanned in 5.15 seconds
    

    Ok, 4567 muss nicht auf sein. Direkt mal ändern, in meinen Firewall Einstellungen, war der Zugriff auf den Port erlaubt(?). Vermutlich vom Testen, irgendwann mal übergeblieben. Die beiden Zeilen gelöscht und iptables neu geladen. (editiert am 25.9.21)

            $IP4TABLES -A INPUT -p tcp --dport 4567 -j ACCEPT
            $IP6TABLES -A INPUT -p tcp --dport 4567 -j ACCEPT
    

    Danach Kontrolle.

    root@webserver1-php:~# nmap 136.243.29.254
    Starting Nmap 7.80 ( https://nmap.org ) at 2021-09-24 20:24 CEST
    Nmap scan report for static.254.29.243.136.clients.your-server.de (136.243.29.254)
    Host is up (0.00021s latency).
    Not shown: 997 filtered ports
    PORT    STATE SERVICE
    22/tcp  open  ssh
    80/tcp  open  http
    443/tcp open  https
    
    Nmap done: 1 IP address (1 host up) scanned in 5.14 seconds
    

    Jetzt ist schön 😊

    Wie kann man denn einen Dienst testen? Dazu kann man telnet benutzen.

    root@webserver1-php:~# telnet 136.243.29.254 80
    Trying 136.243.29.254...
    Connected to 136.243.29.254.
    Escape character is '^]'.
    

    Das hier zeigt uns einen Verbindungsversuch auf Port 80 (http), dieser Versuch war erfolgreich. Ein erfolgloser Versuch, sieht so aus.

    root@webserver1-php:~# telnet 136.243.29.254 4567
    Trying 136.243.29.254...
    telnet: Unable to connect to remote host: Connection refused
    

    Das kann nun mehrere Ursachen haben

    • iptables blockt den Port
    • der Dienst ist gar nicht gestartet, oder mit Fehler ausgestiegen usw.

    Zum Schluss noch einen traceroute. Ein traceroute zeigt uns den Weg zum Server.

    root@webserver1-php:~# traceroute 8.8.8.8
    traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
     1  static.xxx.xx.243.136.clients.your-server.de (136.243.xx.xxx)  0.053 ms  0.031 ms  0.023 ms
     2  static.129.9.9.5.clients.your-server.de (5.9.9.129)  0.352 ms  0.390 ms  0.376 ms
     3  * * *
     4  core1.fra.hetzner.com (213.239.229.77)  4.821 ms core1.fra.hetzner.com (213.239.203.153)  17.872 ms core1.fra.hetzner.com (213.239.229.77)  12.502 ms
     5  google.peering.cz (91.213.211.170)  15.142 ms  11.622 ms  11.583 ms
     6  108.170.245.49 (108.170.245.49)  11.473 ms 108.170.245.33 (108.170.245.33)  11.683 ms 108.170.245.49 (108.170.245.49)  14.364 ms
     7  108.170.238.161 (108.170.238.161)  12.702 ms 108.170.238.157 (108.170.238.157)  11.587 ms  11.609 ms
     8  dns.google (8.8.8.8)  11.513 ms  14.383 ms  11.528 ms
    
  • Podman & nftables

    Linux podman nftables linux
    1
    0 Stimmen
    1 Beiträge
    102 Aufrufe
    Niemand hat geantwortet
  • Debian 12 & fail2ban

    Linux debian linux fail2ban
    1
    0 Stimmen
    1 Beiträge
    107 Aufrufe
    Niemand hat geantwortet
  • Fedora 42

    Linux fedora linux btrfs
    2
    2
    0 Stimmen
    2 Beiträge
    417 Aufrufe
    FrankMF
    Ich habe mir gestern den Cosmic Desktop angesehen. Davon abgesehen, das er noch ein sehr frühes Stadium ist, hat er mir nicht wirklich gefallen. Also heute mal die Referenz von Fedora installiert, die Workstation mit Gnome Desktop. Wer hier lange mitliest, weiß das ich kein Fanboy vom Gnome Desktop bin. Aber ich wollte unbedingt mal den Anaconda Installer sehen. Der ist richtig gut geworden und das man jetzt das Tastaturlayout für die Verschlüsselung einstellen kann, wird hoffentlich in Zukunft verhindern, das ich mit einer amerikanischen Tastatur meine Passphrase eingeben muss Da war ja vorher bei meinen Test das Problem, das ich nach Standby nicht über die Tastatur aufwecken konnte. Das war eine Einstellung im BIOS, irgendwas mit Wakeup/BIOS/USB Jetzt funktioniert das auch einwandfrei. Und zu Gnome sag ich mal nichts, ich bin da vermutlich zu alt für Ich lasse es aber mal ein paar Tage auf der Platte, vielleicht erkenne ich ja noch seinen Nutzen. Zum Schluss, das schöne an FOSS ist, wir haben die Wahl welchen Desktop wir installieren dürfen. Fedora 42 sieht gut aus und läuft rund. Jetzt mal suchen, wo ich in Gnome diese beschissene Updateverhalten ausschalten kann, was aussieht wie ein Windows. Das braucht nun wirklich niemand.
  • fail2ban auf einem systemd System (Debian 12)

    Linux linux fail2ban
    2
    0 Stimmen
    2 Beiträge
    264 Aufrufe
    FrankMF
    Auf Debian 13 Trixie fehlt noch folgendes apt install python3-setuptools
  • Minio - Objektspeicher selbst gehostet

    Linux minio linux restic
    1
    1
    0 Stimmen
    1 Beiträge
    215 Aufrufe
    Niemand hat geantwortet
  • nano - Zeilennummern dauerhaft anzeigen

    Linux linux
    3
    2
    0 Stimmen
    3 Beiträge
    3k Aufrufe
    FrankMF
    @masko Danke für die Ergänzung. Um den Code zu markieren, kannst Du im Texteditor auf </> klicken oder einfach 4 Leerzeichen vor den Code setzen. Dann sieht es besser aus Und Willkommen im Forum!
  • ZFS - Wichtige Befehle

    Linux zfs linux
    3
    0 Stimmen
    3 Beiträge
    1k Aufrufe
    FrankMF
    Heute mal drüber gestolpert, das es auch so was geben kann. root@pve2:~# zpool status pool: pool_NAS state: ONLINE status: Some supported and requested features are not enabled on the pool. The pool can still be used, but some features are unavailable. action: Enable all features using 'zpool upgrade'. Once this is done, the pool may no longer be accessible by software that does not support the features. See zpool-features(7) for details. scan: scrub repaired 0B in 00:20:50 with 0 errors on Sun Apr 13 00:44:51 2025 config: NAME STATE READ WRITE CKSUM pool_NAS ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 ata-WDC_WDS100T1R0A-68A4W0_230520800733 ONLINE 0 0 0 ata-WDC_WDS100T1R0A-68A4W0_230520801376 ONLINE 0 0 0 errors: No known data errors Was machen? Als erstes mal ein Backup angestoßen. Danach root@pve2:~# zpool get all pool_NAS | grep feature pool_NAS feature@async_destroy enabled local pool_NAS feature@empty_bpobj active local pool_NAS feature@lz4_compress active local pool_NAS feature@multi_vdev_crash_dump enabled local pool_NAS feature@spacemap_histogram active local pool_NAS feature@enabled_txg active local pool_NAS feature@hole_birth active local pool_NAS feature@extensible_dataset active local pool_NAS feature@embedded_data active local pool_NAS feature@bookmarks enabled local pool_NAS feature@filesystem_limits enabled local pool_NAS feature@large_blocks enabled local pool_NAS feature@large_dnode enabled local pool_NAS feature@sha512 enabled local pool_NAS feature@skein enabled local pool_NAS feature@edonr enabled local pool_NAS feature@userobj_accounting active local pool_NAS feature@encryption enabled local pool_NAS feature@project_quota active local pool_NAS feature@device_removal enabled local pool_NAS feature@obsolete_counts enabled local pool_NAS feature@zpool_checkpoint enabled local pool_NAS feature@spacemap_v2 active local pool_NAS feature@allocation_classes enabled local pool_NAS feature@resilver_defer enabled local pool_NAS feature@bookmark_v2 enabled local pool_NAS feature@redaction_bookmarks enabled local pool_NAS feature@redacted_datasets enabled local pool_NAS feature@bookmark_written enabled local pool_NAS feature@log_spacemap active local pool_NAS feature@livelist enabled local pool_NAS feature@device_rebuild enabled local pool_NAS feature@zstd_compress enabled local pool_NAS feature@draid enabled local pool_NAS feature@zilsaxattr disabled local pool_NAS feature@head_errlog disabled local pool_NAS feature@blake3 disabled local pool_NAS feature@block_cloning disabled local pool_NAS feature@vdev_zaps_v2 disabled local Das kommt von neuen Funktionen, die zu ZFS hinzugefügt wurden und bei Erstellung des Pools nicht vorhanden waren. Dann upgraden wir mal root@pve2:~# zpool upgrade pool_NAS This system supports ZFS pool feature flags. Enabled the following features on 'pool_NAS': zilsaxattr head_errlog blake3 block_cloning vdev_zaps_v2 Kontrolle root@pve2:~# zpool status pool: pool_NAS state: ONLINE scan: scrub repaired 0B in 00:20:50 with 0 errors on Sun Apr 13 00:44:51 2025 config: NAME STATE READ WRITE CKSUM pool_NAS ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 ata-WDC_WDS100T1R0A-68A4W0_230520800733 ONLINE 0 0 0 ata-WDC_WDS100T1R0A-68A4W0_230520801376 ONLINE 0 0 0 errors: No known data errors Features kontrollieren root@pve2:~# zpool get all pool_NAS | grep feature pool_NAS feature@async_destroy enabled local pool_NAS feature@empty_bpobj active local pool_NAS feature@lz4_compress active local pool_NAS feature@multi_vdev_crash_dump enabled local pool_NAS feature@spacemap_histogram active local pool_NAS feature@enabled_txg active local pool_NAS feature@hole_birth active local pool_NAS feature@extensible_dataset active local pool_NAS feature@embedded_data active local pool_NAS feature@bookmarks enabled local pool_NAS feature@filesystem_limits enabled local pool_NAS feature@large_blocks enabled local pool_NAS feature@large_dnode enabled local pool_NAS feature@sha512 enabled local pool_NAS feature@skein enabled local pool_NAS feature@edonr enabled local pool_NAS feature@userobj_accounting active local pool_NAS feature@encryption enabled local pool_NAS feature@project_quota active local pool_NAS feature@device_removal enabled local pool_NAS feature@obsolete_counts enabled local pool_NAS feature@zpool_checkpoint enabled local pool_NAS feature@spacemap_v2 active local pool_NAS feature@allocation_classes enabled local pool_NAS feature@resilver_defer enabled local pool_NAS feature@bookmark_v2 enabled local pool_NAS feature@redaction_bookmarks enabled local pool_NAS feature@redacted_datasets enabled local pool_NAS feature@bookmark_written enabled local pool_NAS feature@log_spacemap active local pool_NAS feature@livelist enabled local pool_NAS feature@device_rebuild enabled local pool_NAS feature@zstd_compress enabled local pool_NAS feature@draid enabled local pool_NAS feature@zilsaxattr enabled local pool_NAS feature@head_errlog active local pool_NAS feature@blake3 enabled local pool_NAS feature@block_cloning enabled local pool_NAS feature@vdev_zaps_v2 enabled local So, alle neuen Features aktiviert. Jetzt kann der Pool weiterhin seine Arbeit machen.
  • Liste von Linuxbefehlen

    Angeheftet Linux linux
    5
    1
    0 Stimmen
    5 Beiträge
    1k Aufrufe
    FrankMF
    Kurzer IPv6 Ping, ohne viel Tipparbeit root@:~# ping 2600:: PING 2600::(2600::) 56 data bytes 64 bytes from 2600::: icmp_seq=1 ttl=55 time=14.9 ms 64 bytes from 2600::: icmp_seq=2 ttl=55 time=13.0 ms 64 bytes from 2600::: icmp_seq=3 ttl=55 time=15.9 ms