(2024 edition)
First of all, I like to use TAP interfaces for networking, since they are full featured interfaces and can be used as non-root. The absolutely best way to configure networking for SIMH would be a standard network bridge between WLAN0 and a TAP interface, and this is how I've done it on my normal SIMH setups. However, bridging is not possible with Raspberry Pi's WLAN interface.
Other options would be the builtin NAT functionality in SIMH, or a normal NAT setup between wlan0 and a tap interface (which I initially settled on).
With Proxy ARP, we can achieve pretty closely the same result as with a network bridge, where the IP address of the SIMH instance will appear in the same network as your Raspberry Pi. Some caveasts, though:
- Since proxy arp relies on IP routing, DECnet won't work. DECnet over TCP/IP might work.
- DHCP doesn't work without some extra relaying utilities.
- It can be a bit mysterious to setup, if you're not experienced with linux or networking
Install the required ubuntu package:
$ sudo apt-get install parprouted
You need to decide on at least two IP addresses, that are not conflicting with the DHCP pool or any other IP in your network.
- IP address of the tap interface on your Raspberry Pi
- IP address of your simh instance (your actual emulated PiDP-11 running RSX/BSD/etc)
In my examples I will be using 192.168.0.16 for the tap interface, and 192.168.0.17 for the simh instance.
This setup assumes you're running simh manually as non-root user. The default install scripts for PiDP-11 currently run simh as root (TODO: is this still true?).
We need to set some sysctl parameters for Proxy ARP to work. Create a new file /etc/sysctl.d/97-proxy-arp.conf
, and add the following:
net.ipv4.conf.all.proxy_arp=1
net.ipv4.ip_forward=1
Reboot to make the above changes active, or add them manually using sysctl from command line.
Create a new network connection using NetworkManager that defines our tap interface.
The command below will:
- create a connection named
tap-simh0
- ..with create a network interface called
tap-simh0
- assigned to the user that this command is being run at (
id -u
) - with a manually specified IP address and mask
192.168.0.16/32
sudo nmcli conn add type tun ifname tap-simh0 con-name tap-simh0 mode tap owner `id -u` ip4 192.168.0.16/32
Next, let's place our tap interface in a configuration file in /etc/default/parprouted:
TAP_INTERFACES="tap-simh0"
Start editing a new systemd service using the following command:
systemctl edit --full parprouted.service
And add these contents:
[Unit]
Description=Proxy ARP Daemon
After=network.target
[Service]
Type=forking
# parprouted doesn't maintain a pidfile
PIDFile=
Restart=on-failure
RestartSec=10
# Read tap device names from external file
EnvironmentFile=/etc/default/parprouted
# Set promisc mode for wlan0
ExecStartPre=/sbin/ip link set wlan0 promisc on
# Start parprouted
ExecStart=/usr/sbin/parprouted wlan0 $TAP_INTERFACES
# Unset promisc mode for wlan0
ExecStopPost=/sbin/ip link set wlan0 promisc off
[Install]
WantedBy=wpa_supplicant.service
Bring up the tap interface:
nmcli conn up tap-simh0
And start the proxy arp bridging service:
systemctl start parprouted
$ ip addr show tap-simh0
5: tap-simh0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 32:51:87:99:10:ee brd ff:ff:ff:ff:ff:ff
inet 192.168.0.16/32 scope global noprefixroute tap-simh0
valid_lft forever preferred_lft forever
inet6 fe80::7565:5b1d:5cb3:48f0/64 scope link tentative noprefixroute
valid_lft forever preferred_lft forever
$ ps ax|grep parprouted
715 ? Ssl 0:00 /usr/sbin/parprouted wlan0 tap-simh0
$ sysctl net.ipv4.conf.all.proxy_arp; sysctl net.ipv4.ip_forward
net.ipv4.conf.all.proxy_arp = 1
net.ipv4.ip_forward = 1
$ ip link show wlan0 | grep --color PROMISC
3: wlan0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DORMANT group default qlen 1000
I like to specify MAC address, especially when dealing with proxy ARP to make possible troubleshooting easier:
; Ethernet
set xu enable
set xu type=deuna
set xu mac=aa:00:04:00:0c:34
attach xu tap:tap-simh0
sho xu
Use a static IP address. If things go okay, experiment with DHCP relays later. Details of installing RSX-11M+ or 2.11BSD are beyond the scope of this guide, but my install logs can be found here:
https://gist.github.com/desaster/c49b0f7afa5e061b8f33f159e521b6ee
Proxy ARP can be a challenge to figure out, if you're not familiar with routing or ethernet in general. Here's a checklist of things to check when facing issues:
$ sudo iptables -n -L; sudo iptables -n -t nat -L
$ ps ax|grep parprouted
412 ? Ssl 0:03 /usr/sbin/parprouted wlan0 tap-simh0
$ ip route | grep '192.168.0.17.*tap'
192.168.0.17 dev tap-simh0 scope link metric 50
If you can't access the simh from your local network, can you still access it locally on the Raspberry Pi?
$ ping -c 1 192.168.0.17
PING 192.168.0.17 (192.168.0.17) 56(84) bytes of data.
64 bytes from 192.168.0.17: icmp_seq=1 ttl=255 time=27.8 ms
sim> attach xu tap:tap-simh0
Eth: open error - Device or resource busy
@Robert-van-Engelen Thanks for testing out the setup. Looks like I forgot to add instructions on how the service can be started on bootup.
To enable service starting automatically on bootup, you should run:
And to disable it: