Posts from 2020
-
How to make an ARM virtual machine (armhf/aarch64)
(Read more...)Update (2022-03-19): I wrote about a new way to create an ARM virtual machine that’s simpler and handles kernel updates properly. I highly suggest you follow those instructions instead, unless you are building a chroot.
I noticed that very few people seem to know how to create a full ARM virtual machine, so I decided to create a quick guide.
This tutorial will use aarch64 and Debian as examples, but the same methodology should work for 32-bit ARM and other distributions. The instructions can also be adapted to create a simple chroot.
-
Run a Linux Program on a Different Network Interface
(Read more...)Sometimes, you have multiple Internet connections, whether physical or virtual, and you want a few programs to access the Internet through one connection without making it the default gateway. For example, if you want a program to connect to the Internet through a VPN, but without forcing the entire system’s traffic through the VPN as well.
The traditional way to do this is with packet marking with
iptablesand anip ruleto force marked packets through a different routing table to send the traffic to the correct destination. However, as the source IP was selected before routing, anSNATrule iniptablesis required to change the source IP. This is ugly and clearly a hack.However, since around 2013, Linux has introduced networking namespaces, which can be managed via
ip netnsas part of theiproute2package. We can easily exploit this feature to achieve the desired goal with minimal fuss.