Page 1 of 1

setting up tuntap networking on linux?

Posted: Tue Jan 17, 2017 3:14 pm
by darthnvader
Can I still use Tuntap networking on Linux?

Does anyone know how to set it up?

I set my ether to tun in ~/.basilisk_ii_pref and I copied the tunconfig file to /usr/share/BasiliskII/tunconfig, and ran echo 1 >/proc/sys/net/ipv4/ip_forward as root, but I don't know how to set the Mac tcp/ip settings, or even if tuntap still works on Linux.

Slirp networking is broken on linux, and Sheep_net causes a hard reset of my chromebook, seems not to want to play nice with the built in mlan0 wifi.

Re: setting up tuntap networking on linux?

Posted: Tue Jan 17, 2017 10:57 pm
by darthnvader
I played around with it a bit, it seem the "tun" code maybe broken in BasiliskII, when I set the ether device to tun it still tries to default to Sheep_net. The tunconfig script never get executed, and it never creates a tun0 in ifconfig.

I tried to execute the script manually but it returns:

Code: Select all

172.20..1: Unknown host
ifconfig: `--help' gives usage information.
iptables v1.4.21: host/network `172.20..0' not found
Try `iptables -h' or 'iptables --help' for more information.
So the script maybe out of date too.

Can anyone have a look at the tunconfig script and see what it should do, maybe I can set it up manually, but I can't seem to figure out what the script should do, I'm not that good at scripting.

I can manually create a tun0 and give it the proper address(172.20.40.1) and netmask(255.255.255.0) but I can't seem to set the destination, I'm assuming it should be the ip address of the Mac OS within BasiliskII(172.20.40.2), is that right?

Re: setting up tuntap networking on linux?

Posted: Tue Jan 17, 2017 11:51 pm
by adespoton
darthnvader wrote:I played around with it a bit, it seem the "tun" code maybe broken in BasiliskII, when I set the ether device to tun it still tries to default to Sheep_net. The tunconfig script never get executed, and it never creates a tun0 in ifconfig.

I tried to execute the script manually but it returns:

Code: Select all

172.20..1: Unknown host
ifconfig: `--help' gives usage information.
iptables v1.4.21: host/network `172.20..0' not found
Try `iptables -h' or 'iptables --help' for more information.
So the script maybe out of date too.

Can anyone have a look at the tunconfig script and see what it should do, maybe I can set it up manually, but I can't seem to figure out what the script should do, I'm not that good at scripting.

I can manually create a tun0 and give it the proper address(172.20.40.1) and netmask(255.255.255.0) but I can't seem to set the destination, I'm assuming it should be the ip address of the Mac OS within BasiliskII(172.20.40.2), is that right?
The tunconfig script is supposed to bind a virtual tunnel device to an existing port in the BII process. In order for it to work, BII must already be running. In the initialization stage, BII sets up its tunneling port, and then calls the setup script to bind this to a virtual tunnel device, which maps onto your ethernet driver.

Does that make sense?

Re: setting up tuntap networking on linux?

Posted: Wed Jan 18, 2017 3:15 am
by darthnvader
I think, I understand, but setting ether to tun has no effect, it just reports:

Code: Select all

: Cannot open /dev/sheep_net (No such file or directory). Ethernet will not be available.
Seems to completely ignore the "tun" flag. Setting it to "tap" reports:

Code: Select all

: Cannot open /dev/tap (No such file or directory). Ethernet will not be available.
I realize tap is a completely different networking interface from "tun", and it's been deprecated in linux for a long time, or at least is now in the TunTap code. I can still create a Tap0 interface, but it doesn't create it in /dev/tap where the BII code expects it to be,

So it's just my luck lately, four networking options in BII, and none of them will work on my Chromebook.

slirp; crashes BII
sheep_net: hard reset of the Chromebook when BII loads
tap: deprecated
tun: broken code

Re: setting up tuntap networking on linux?

Posted: Wed Jan 18, 2017 10:36 pm
by adespoton
You could symlink the tap device. But that seems really odd with tun; possibly when someone was fixing a sheep_net bug, they killed a case statement?

Re: setting up tuntap networking on linux?

Posted: Thu Jan 19, 2017 2:04 am
by darthnvader
Thanks, I already tried to link the Tap0 device, but BII complained this it was a file, and refused to use it.