tun/tap issue in Linux

About BasiliskII, a 68k Mac emulator for Windows, MacOSX, and Linux that can run System 7.x through MacOS 8.1.

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
User avatar
rickyzhang
Apple Corer
Posts: 205
Joined: Mon Sep 15, 2014 7:59 pm

tun/tap issue in Linux

Post by rickyzhang »

I forked BasiliskII from https://github.com/cebix/macemu. I believe this is the official one.

I tried to enable networking in Fedora 20 host. But it all failed.

First, I tried to fix sheep_net module compiled in 3.15 by replacing interrupt API (https://github.com/rickyzhang82/macemu/ ... 87c2052388). The patch can make the module compile and work under kernel 3.15. I can ping to outside URL and ftp to my local host. But it doesn't seem to work fully functional. I can't browse web outside.

And then I tried to fix tun/tap. The patch are not finished yet. See below.

My question is that are there any easy route to make networking work in Linux?

--- /tmp/YEPw7d_configure.ac
+++ /home/Ricky/repo/github/macemu/BasiliskII/src/Unix/configure.ac
@@ -825,6 +825,8 @@
AC_CACHE_CHECK([whether TUN/TAP is supported],
ac_cv_tun_tap_support, [
AC_TRY_COMPILE([
+ #include <sys/socket.h>
+ #include <string.h>
#if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H)
#include <linux/if.h>
#include <linux/if_tun.h>

--- /tmp/aVQ8ij_tunconfig
+++ /home/Ricky/repo/github/macemu/BasiliskII/src/Unix/tunconfig
@@ -77,7 +77,7 @@
#########################################################

{
- $IPTABLES -t nat -D POSTROUTING -s $TUN_NET -d ! $TUN_NET -j MASQUERADE
+ $IPTABLES -t nat -D POSTROUTING -s $TUN_NET ! -d $TUN_NET -j MASQUERADE
} >& /dev/null

#########################################################
@@ -96,7 +96,7 @@
$IFCONFIG $TUN_DEV $TUN_HOST

# masquerade the tun network
- $IPTABLES -t nat -A POSTROUTING -s $TUN_NET -d ! $TUN_NET -j MASQUERADE
+ $IPTABLES -t nat -A POSTROUTING -s $TUN_NET ! -d $TUN_NET -j MASQUERADE
}

exit 0
There is an App for that!
https://github.com/rickyzhang82
Post Reply