Skip to main content

brnet

These is a networking tool to make running emulated systems under Linux a little easier and more secure.

I have been using simh and klh10 a lot recently to emulate old computers and operating systems. Networking has been a particular pain because most of these systems require raw access to the network devices, and that typically means running the as root.

I didn't want to do that. So I wrote brnet.

What this script does is to take the interface you specify (defaulting to eth0) and turn it into a bridge device. The using a user and group you specify (it defaults to pi/adm, which is correct for a PiDP-11), it creates a number of tap interfaces (defaulting to 4), and connects them to the bridge too.

The point of doing that is so that you can run brnet with root privileges to create network devices that another user can own and have full control of without requiring escalated privileges.

After running brnet, you can therefore use, say, the tap0 interface in a guest system as your emulated ethernet device, and run as your normal emulator user without sudo, and still have the network interface work.

Installing

pip install brnet, or check out the repository and do a pip install -e . You probably want to do this in a virtualenv, and if you do that, you probably want to install a wrapper script as /usr/local/bin/brnet to activate the appropriate virtualenv and then run the brnet command (virtualenv activation will put the new stuff at the head of your $PATH). One approach to this is here.

Then you want to drop the following into /etc/network/interfaces.d to start the network after the physical interface comes up. I called my file 01-phys-to-bridge.

Examples

To run using the defaults, which should work for a Raspberry Pi running the PiDP-11 software: brnet start.

To run with a different user and group and more tap devices:

brnet -u adam -g wheel -n 8 start

To shut down the bridge and put things back the way they were:

brnet stop

brnet -h will give you a help message explaining all the parameters.

Metadata

Release files for brnet 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brnet 0.0.6
File Size Uploaded
brnet-0.0.6.tar.gz 21.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for brnet 0.0.6
File Interpreter ABI Platform
brnet-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 29.0 kB

Release files / brnet-0.0.6.tar.gz

Download URL brnet-0.0.6.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d8fab15f09c6f4e58a84d57c6239d623977a735496d3b53839133c31f496eea0
BLAKE2b-256 checksum
How to use checksums
10dc204828c7878769d31f29e056afc42d2836c3926501159a13c5ad93d25d0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / brnet-0.0.6-py3-none-any.whl

Download URL brnet-0.0.6-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6131bb1ea5b38f30b9b0e3a604ed9f6b19e5fb894abae5939900abed61906f9
BLAKE2b-256 checksum
How to use checksums
a5601f2827f398997094a2890cc45e53268fd1fe5828a72504bb2cc3ac39932b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page