This SANA-II driver works by copying Ethernet frames back and forth between the Amiga and a virtual ethernet interface (tap0) on the Raspberry Pi. The Pi will, when configured properly, do network address translation (NAT) and route packets from the Amiga to the Internet.
If the install-pi.sh
script was run to setup the Raspberry Pi then the following
steps have already been carried out, and no more configuration should be needed
unless your network require some special configuration.
- Install pytun:
sudo pip3 install python-pytun
. - Copy
ethernet.py
to/opt/a314/ethernet.py
. - Update
/etc/opt/a314/a314d.conf
with a line that startsethernet.py
on demand.- In order for
a314d
to pick up the changes ina314d.conf
you'll have to restarta314d
, either bysudo systemctl restart a314d
or by rebooting the Pi.
- In order for
- Copy
pi-config/tap0
to/etc/network/interfaces.d/tap0
. This file creates a tap device with ip address 192.168.2.1 when the Raspberry Pi is booted up. - Enable ip forwarding by uncommenting the line in
/etc/sysctl.conf
that saysnet.ipv4.ip_forward=1
. - Add the lines in
pi-config/rc.local
to the bottom of/etc/rc.local
just beforeexit 0
. This create iptables rules that forwards packets from thetap0
interface to thewlan0
interface.- Please note that if the Pi is connected using wired ethernet then
wlan0
should be changed toeth0
.
- Please note that if the Pi is connected using wired ethernet then
This has been tested with the Roadshow and the MiamiDX TCP/IP stacks. These instructions show how to configure Roadshow and Miami for a314ethernet, they do not describe how to install either.
- Copy
a314eth.device
toDEVS:
.
- Copy
amiga-config/A314Eth
toDEVS:NetInterfaces/A314Eth
. - Copy
amiga-config/routes
toDEVS:Internet/routes
. - Copy
amiga-config/name_resolution
toDEVS:Internet/name_resolution
.- You should change the nameserver to a DNS server that works on your network.
- Note that there may be settings in the above two files (
routes
andname_resolution
) that you wish to keep, so look through the changes you are about to make first.
Reboot the Amiga and with some luck you should be able to access the Internet from your Amiga.
- Create new device entry under Hardware
- Click New and select Ethernet
- Name it accordingly, for example
a314eth
- Type should be SANA-II driver
- For Driver, type in, or browse to and select,
DEVS:a314eth.device
and click OK
- Create a new network interface in Interfaces
- Click New and select Ethernet and Internet, click OK
- Select the previously created a314eth and click OK
- Set IP to static and type in
192.168.2.2
- Set Netmask to static and type in
255.255.255.0
- Set Gateway to static and type in
192.168.2.1
- Click OK
- Add a nameserver in Database
- Select DNS servers from the spinner
- Click Add and type in the address of your DNS server and press enter (you can use for example Google's DNS server at
8.8.8.8
if unsure)
- Remember to save your settings!
Click Online and hopefully your Amiga now has internet access.
Autostarting Miami and further configuration is left to the user.
The above described configuration uses a method called masquerading to create a separate network for your Amiga behind the Pi. While this has the advantage of shielding it from attacks from other computers, sometimes you may want to be able to access network services on your Amiga from other computers besides the Pi.
To facilitate that access, the firewall on the Pi needs to be configured to forward incoming traffic on specific ports on the external interface to the Amiga. The example below assumes that the Pi and Amiga have both been setup as described earlier in this document.
iptables -A PREROUTING -t nat -i wlan0 -p tcp --dport 21 -j DNAT --to 192.168.2.2:21
iptables -A FORWARD -p tcp -d 192.168.2.2 --dport 21 -j ACCEPT
By adding these lines to /etc/rc.local
directly following the other /iptables/ lines, the Pi firewall will start accepting connections to port 21 (FTP) and forwarding them to port 21 on the Amiga allowing an FTP client to connect to an FTP server running on the Amiga.