<?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 Terminal</title><link>https://muisti.atk-neuvos.fi/tags/networking/</link><description>Recent content in Networking on Terminal</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 09 Nov 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://muisti.atk-neuvos.fi/tags/networking/index.xml" rel="self" type="application/rss+xml"/><item><title>Wireguard VPN networking</title><link>https://muisti.atk-neuvos.fi/posts/wireguard/</link><pubDate>Mon, 09 Nov 2026 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/wireguard/</guid><description>&lt;h1 id="background"&gt;Background&lt;/h1&gt;
&lt;p&gt;As easier or ad-hoc VPN solution to openvpn, wireguard provides user space tools for point-to-point networking with roaming clients.&lt;/p&gt;
&lt;p&gt;One static public host is needed.&lt;/p&gt;
&lt;h1 id="network-topology"&gt;Network topology&lt;/h1&gt;
&lt;h2 id="server"&gt;Server&lt;/h2&gt;
&lt;p&gt;Any publicly reachable host with optional DNS name.&lt;/p&gt;
&lt;p&gt;It also has private address 172.16.0.1 for WG interface.&lt;/p&gt;
&lt;h2 id="roaming-peer-1"&gt;Roaming peer 1&lt;/h2&gt;
&lt;p&gt;Using any network anywhere.
WG address is 172.16.0.2&lt;/p&gt;
&lt;h1 id="package-setup-for-all-hosts"&gt;Package setup for all hosts&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;sudo apt install wireguard-tools
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="key-generation"&gt;Key generation&lt;/h1&gt;
&lt;h2 id="server-1"&gt;Server&lt;/h2&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wg genkey &amp;gt;/root/wg/srv.key
wg pubkey &amp;lt;/root/wg/srv.key &amp;gt;/root/wg/srv.pub
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="peer-1"&gt;Peer 1&lt;/h2&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wg genkey &amp;gt;/root/wg/stinky.key
wg pubkey &amp;lt;/root/wg/stinky.key &amp;gt;/root/wg/stinky.pub
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="server-setup"&gt;Server setup&lt;/h1&gt;
&lt;h2 id="allow-traffic-at-udp12345"&gt;Allow traffic at udp/12345&lt;/h2&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;ufw allow udp/12345 comment &amp;#39;wireguard&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="public-server-config"&gt;Public server config&lt;/h2&gt;
&lt;p&gt;The peer key below is stinky.pub contents&lt;/p&gt;</description></item><item><title>Test ethernet cables with two local interfaces</title><link>https://muisti.atk-neuvos.fi/posts/ethernet/</link><pubDate>Thu, 29 May 2025 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/ethernet/</guid><description>&lt;ol&gt;
&lt;li&gt;Connect (usb) ethernet adapters and some cable between them&lt;/li&gt;
&lt;li&gt;Disable both interfaces from network settings / network manager&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src="https://muisti.atk-neuvos.fi/posts/ethernet/network.png" alt="network settings"&gt;&lt;/p&gt;
&lt;ol start="3"&gt;
&lt;li&gt;Check interface visibility&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# ip a | grep enx
enx7cc2c6448e83: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt;
enx60a4b7ddea36: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;ol start="4"&gt;
&lt;li&gt;Setup first interface&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# add IP address to 1st interface
ip a add 10.10.10.10/24 dev enx7cc2c6448e83
&lt;/code&gt;&lt;/pre&gt;&lt;ol start="5"&gt;
&lt;li&gt;Setup new network namespace and second interface&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# create new network namespace
ip netns add lan2

# move 2nd interface to new namespace
ip link set enx60a4b7ddea36 netns lan2

# bring up 2nd interface
ip netns exec lan2 ip link set dev enx60a4b7ddea36 up

# add IP address to 2nd interface
ip netns exec lan2 ip a add 10.10.10.11/24 dev enx60a4b7ddea36
&lt;/code&gt;&lt;/pre&gt;&lt;ol start="6"&gt;
&lt;li&gt;Test connection between interfaces&lt;/li&gt;
&lt;/ol&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# ping 10.10.10.11

PING 10.10.10.11 (10.10.10.11) 56(84) bytes of data.
64 bytes from 10.10.10.11: icmp_seq=1 ttl=64 time=0.755 ms
64 bytes from 10.10.10.11: icmp_seq=2 ttl=64 time=0.743 ms
64 bytes from 10.10.10.11: icmp_seq=3 ttl=64 time=1.03 ms

3 packets transmitted, 3 received, 0% packet loss, time 2087ms
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>OpenVPN networking</title><link>https://muisti.atk-neuvos.fi/posts/openvpn/</link><pubDate>Thu, 03 Apr 2025 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/openvpn/</guid><description>&lt;h1 id="package-setup-for-building-files-at-any-host-computer"&gt;Package setup for building files at any host computer&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;sudo apt install easy-rsa openssl openvpn
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="package-setup-for-openvpn-server"&gt;Package setup for OpenVPN server&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;sudo apt install openvpn
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="create-directory-for-building-and-keeping-keyfiles"&gt;Create directory for building and keeping keyfiles&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;mkdir ~/vpn_repo
cd ~/vpn_repo
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="-from-here-on-everything-happens-at-vpn_repo--"&gt;*** From here on, everything happens at ~/vpn_repo !!! ***&lt;/h1&gt;
&lt;h1 id="fetch--prepare-easy-tls"&gt;Fetch &amp;amp; prepare easy-tls&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wget https://raw.githubusercontent.com/TinCanTech/easy-tls/refs/heads/master/easytls
chmod 750 easytls
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="for-creating-all-the-needed-openvpn-server-files"&gt;For creating all the needed OpenVPN server files&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;cat &amp;gt;server.sh&lt;/code&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;#!/bin/bash

# cert &amp;amp; ca expiry 10 years
export EASYRSA_KEY_SIZE=2048
export EASYRSA_CA_EXPIRE=3650
export EASYRSA_CERT_EXPIRE=3650

TARGET=$1
USER=$2
PASS=$3

if [ -z $TARGET ]
then
 echo &amp;#34;Give servername as arg&amp;#34;
 exit
fi

make-cadir $TARGET
if [ $? -eq 0 ]
 then
 cd $TARGET

 # build server cert package
 ./easyrsa init-pki
 echo $TARGET | ./easyrsa build-ca nopass
 ./easyrsa gen-dh
 echo yes | ./easyrsa build-server-full $TARGET nopass

 # prepare tls-auth key
 if [[ ! -d pki/easytls ]]
 then
 ../easytls init-tls
 ../easytls build-tls-auth
 fi

 cd ..
 mkdir -p out
 # symlink all files needed on server side
 ln -srf $TARGET/pki/private/$TARGET.key out/
 ln -srf $TARGET/pki/ca.crt out/${TARGET}_ca.crt
 ln -srf $TARGET/pki/easytls/tls-auth.key out/${TARGET}_tls-auth.key
 ln -srf $TARGET/pki/dh.pem out/${TARGET}_dh.pem
 ln -srf $TARGET/pki/issued/$TARGET.crt out/

 echo &amp;#34;#### OpenVPN server files&amp;#34;
 find out | tail +2
 echo &amp;#34;####&amp;#34;
 echo &amp;#34;Copy these files to server /etc/openvpn/server/&amp;#34;
fi
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="for-creating-client-profiles"&gt;For creating client profiles&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;cat &amp;gt;gen_user.sh&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Thunderbolt networking</title><link>https://muisti.atk-neuvos.fi/posts/thunderbolt/</link><pubDate>Mon, 24 Mar 2025 00:00:00 +0000</pubDate><guid>https://muisti.atk-neuvos.fi/posts/thunderbolt/</guid><description>&lt;h1 id="setup"&gt;Setup&lt;/h1&gt;
&lt;p&gt;Connect USB4/TB cable between computers.
Stay vigilant, most cables are not USB4/TB capable.&lt;/p&gt;
&lt;p&gt;Host A:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;modprobe thunderbolt-net
ip a add 10.10.10.10/24 dev thunderbolt0
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Host B:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;ip a add 10.10.10.11/24 dev thunderbolt0
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="test-network"&gt;Test network&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# Host A:
iperf -s

# Host B:
iperf -i 10 -c 10.10.10.10
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="results"&gt;Results&lt;/h1&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;------------------------------------------------------------
Client connecting to 10.10.10.10, TCP port 5001
TCP window size: 16.0 KByte (default)
------------------------------------------------------------
[ 1] local 10.10.10.11 port 53846 connected with 10.10.10.10
[ ID] Interval Transfer Bandwidth
[ 1] 0.0000-10.0000 sec 21.8 GBytes 18.7 Gbits/sec
[ 1] 0.0000-10.0019 sec 21.8 GBytes 18.7 Gbits/sec
&lt;/code&gt;&lt;/pre&gt;&lt;h1 id="usage"&gt;Usage&lt;/h1&gt;
&lt;p&gt;Use the interfaces as any other network over ssh, rsync, netcat, scp etc&lt;/p&gt;</description></item></channel></rss>