fraichu
Chat GPT @ chat.openai.com’s answer
Thank you for providing the details. Based on your requirements, you can achieve your goal by utilizing the Linux bridge functionality to create a software-level Layer 2 switch. Here’s an outline of the steps involved:
-
Install the necessary software: Ensure that the
bridge-utils
package is installed on your Linux machine. You can typically install it using the package manager specific to your distribution. For example, on Ubuntu or Debian, you can runsudo apt-get install bridge-utils
. -
Identify your physical network interface: Determine the name of your WiFi network interface that is connected to the ISP router. You can use the
ip link
command to list the available network interfaces. Look for the interface name associated with your WiFi connection (e.g.,wlan0
). -
Disable network management on the physical interface: To prevent network managers from managing the physical interface directly, you’ll want to disable their control. This step may vary depending on your specific network manager. For example, if you’re using NetworkManager, you can edit the configuration file associated with your WiFi connection (usually located in
/etc/NetworkManager/system-connections/
) and setmanaged=false
. Alternatively, you can stop or disable the network manager service temporarily. -
Create a bridge interface: Create a Linux bridge interface using the
brctl
command. For example, you can runsudo brctl addbr br0
to create a bridge namedbr0
. -
Add the physical interface to the bridge: Add your WiFi interface to the bridge using the
brctl addif
command. For example, runsudo brctl addif br0 wlan0
to addwlan0
to the bridge. -
Configure the bridge interface: Assign an IP address to the bridge interface (
br0
) by configuring it in the network configuration files. The specific file to edit depends on your Linux distribution. For example, on Ubuntu or Debian, you can edit/etc/network/interfaces
and add the following lines:auto br0 iface br0 inet dhcp
Alternatively, you can use network management tools like NetworkManager or systemd-networkd to configure the bridge interface.
-
Configure the virtual machines and containers: Configure your virtual machines, Docker containers, and systemd-containers to use the bridge interface (
br0
) as their network interface. This configuration varies depending on the specific technology you are using. For example:- For Docker: Create a new Docker network of type “bridge” and specify the bridge name as
br0
. Then, when creating or running Docker containers, connect them to this network. - For systemd-containers: Configure the
net-attach@.netdev
andnet-attach@.network
units to attach the container to the bridge interface (br0
). This can be done using thesystemctl
command and systemd network configuration files.
- For Docker: Create a new Docker network of type “bridge” and specify the bridge name as
With these steps, your virtual machines, Docker containers, and systemd-containers should be able to obtain IP addresses directly from your ISP router via the software-level Layer 2 switch created using the Linux bridge interface.
Please note that the specific commands and configuration files may vary depending on your Linux distribution and network management setup. Make sure to adapt the instructions accordingly. Additionally, be cautious when modifying network configurations as it can potentially impact your network connectivity.
- Can give NixOS a try if you want to make things extra hard and get more satisfaction from finishing. The biggest advantage is most of your OS & services config will be in a file, so there’s no need to remember a thousand knobs to tune the experience just the way you want - a text file in a git repo will be all your config.
- I’d recommend Namecheap over porkbun. I found porkbun has less features. I specifically needed to wildcard forward email, which works well on namecheap.
- If you’re from Africa, India or some other country where $10 / year is a lot I recommend a 111 class B domain https://gen.xyz/1111b for $1 / year.
- Do you have static IPv4 or globally routable public IPv6 address assigned to your device? I’m ipv6 only selfhoster, and I use inadyn and afraid
- Can use wireguard and then later open ssh once you feel more comfortable.
Not sure, but I think that designing an internet measurement in a RIPE Atlas network might just fit this task? https://atlas.ripe.net/probes/ You have micro cuts, but are those only to the big name websites or to something local as well? Might help answer that, and give ISP data on where exactly are they hitting the bottleneck and what are they missing monitoring.
Is it possible to connect docker / podman directly to the router? I’m operating an L2 bridge https://developers.redhat.com/articles/2022/04/06/introduction-linux-bridging-commands-and-features systemd-nspawn containers can connect to my router directly, but how to do it with docker / podman?