<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Networking on Benjamin Italiaander</title><link>https://tlnd.org/topic/networking/</link><description>Recent content in Networking on Benjamin Italiaander</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 28 Nov 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://tlnd.org/topic/networking/index.xml" rel="self" type="application/rss+xml"/><item><title>Harden an SSH Server: sshd, Firewall and fail2ban</title><link>https://tlnd.org/Linux/ssh/ssh_server_hardening/</link><pubDate>Sat, 28 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/ssh/ssh_server_hardening/</guid><description>&lt;h1 id="-harden-an-ssh-server"&gt;🛡️ Harden an SSH server&lt;/h1&gt;
&lt;p&gt;Every server with port 22 open to the internet gets thousands of login attempts a day. These four steps make them harmless.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;Keep your current SSH session open&lt;/strong&gt; while you change these settings, and test with a &lt;strong&gt;second&lt;/strong&gt; session. If something is wrong, you can still fix it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id="1-log-in-with-a-key-first"&gt;1. Log in with a key first&lt;/h2&gt;
&lt;p&gt;Make sure you can log in with an SSH key before you turn passwords off:&lt;/p&gt;</description></item><item><title>Linux Networking Cheatsheet: ip, nmcli, DNS and WireGuard</title><link>https://tlnd.org/Linux/networking/</link><pubDate>Sat, 28 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/networking/</guid><description>&lt;h1 id="-linux-networking-cheatsheet"&gt;🌐 Linux networking cheatsheet&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;ifconfig&lt;/code&gt;, &lt;code&gt;route&lt;/code&gt; and &lt;code&gt;netstat&lt;/code&gt; are old; on current Linux systems you use &lt;strong&gt;&lt;code&gt;ip&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;ss&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;nmcli&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="addresses-links-and-routes-ip"&gt;Addresses, links and routes: ip&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip -br a &lt;span class="c1"&gt;# all interfaces and addresses, one line each&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip a show dev eth0 &lt;span class="c1"&gt;# one interface, in detail&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip -br link &lt;span class="c1"&gt;# link state (UP/DOWN) and MAC addresses&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip r &lt;span class="c1"&gt;# routing table (IPv4)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip -6 r &lt;span class="c1"&gt;# routing table (IPv6)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip route get 1.1.1.1 &lt;span class="c1"&gt;# which interface and gateway are used for this address?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip neigh &lt;span class="c1"&gt;# ARP / neighbour table: who is on the local network&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip -s link show dev eth0 &lt;span class="c1"&gt;# packet counters and errors&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Temporary changes (gone after a reboot):&lt;/p&gt;</description></item><item><title>Connect to a Dell S4048 serial console in Linux</title><link>https://tlnd.org/Linux/RS232/</link><pubDate>Wed, 07 Sep 2022 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/RS232/</guid><description>&lt;h1 id="connect-to-a-serial-console-in-linux"&gt;Connect to a serial console in Linux&lt;/h1&gt;
&lt;p&gt;I needed to connect to my Dell S4048 and Dell Z9100-ON switches over a serial port in Linux.&lt;/p&gt;
&lt;p&gt;I connected my RS232 cable to the Dell switch, but somehow I got weird characters after connecting.&lt;/p&gt;
&lt;p&gt;The specifications on the Dell site said:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;115200 baud (set the Micro-USB console port to 9600 baud).&lt;/li&gt;
&lt;li&gt;No parity.&lt;/li&gt;
&lt;li&gt;8 data bits.&lt;/li&gt;
&lt;li&gt;1 stop bit.&lt;/li&gt;
&lt;li&gt;No flow control.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I tried minicom and cu, without success.
In the end &lt;a href="http://www.columbia.edu/kermit/ck90.html" class="external-link" target="_blank" rel="noopener"&gt;Kermit&lt;/a&gt; did the trick, with this config file &lt;code&gt;~/.kermrc&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>Connect to a Cisco switch with SSH</title><link>https://tlnd.org/Linux/ssh/cisco/</link><pubDate>Mon, 20 Apr 2020 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/ssh/cisco/</guid><description>&lt;h3 id="introduction"&gt;Introduction&lt;/h3&gt;
&lt;p&gt;I got this error message when I tried to log in to my Cisco switch with SSH.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cisco&lt;/strong&gt;: SSH fails to connect&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Unable to negotiate with [hostname or ip] port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1,diffie-hellman-group14-sha1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can solve this by explicitly allowing the old key exchange method:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ssh -o &lt;span class="nv"&gt;KexAlgorithms&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;+diffie-hellman-group1-sha1 &lt;span class="o"&gt;[&lt;/span&gt;hostname or ip&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;⚠️ These SHA-1 algorithms are outdated and insecure. Only use them for old network equipment, ideally on a management network.&lt;/p&gt;</description></item><item><title>List outgoing connections</title><link>https://tlnd.org/Linux/cli/outgoing_connections/</link><pubDate>Sat, 02 Apr 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/cli/outgoing_connections/</guid><description>&lt;h1 id="how-to-list-outgoing-connections-on-the-linux-cli"&gt;How to list outgoing connections on the Linux CLI&lt;/h1&gt;
&lt;p&gt;A small example of how to show the remote addresses of your connections.&lt;/p&gt;
&lt;p&gt;Outgoing TCP connections:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;netstat -atn &lt;span class="p"&gt;|&lt;/span&gt; tr -s &lt;span class="s1"&gt;&amp;#39; &amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; cut -f5 -d &lt;span class="s1"&gt;&amp;#39; &amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; grep -v &lt;span class="s1"&gt;&amp;#39;127.0.0.1&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Outgoing UDP connections:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;netstat -aun &lt;span class="p"&gt;|&lt;/span&gt; tr -s &lt;span class="s1"&gt;&amp;#39; &amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; cut -f5 -d &lt;span class="s1"&gt;&amp;#39; &amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; grep -v &lt;span class="s1"&gt;&amp;#39;127.0.0.1&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On newer systems &lt;code&gt;netstat&lt;/code&gt; may not be installed; &lt;code&gt;ss -tn&lt;/code&gt; (TCP) and &lt;code&gt;ss -un&lt;/code&gt; (UDP) give similar output.&lt;/p&gt;
&lt;h3 id="with-ss-the-modern-way"&gt;With &lt;code&gt;ss&lt;/code&gt; (the modern way)&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;ss&lt;/code&gt; is installed everywhere and can filter by state itself. Only established connections, without the header, with the program that owns them:&lt;/p&gt;</description></item></channel></rss>