general networking question

Thomas Geenen mol-general@lists.maconlinux.org
Mon, 24 Jun 2002 15:31:30 -0400


hi again
still problems with the network 
i think that all the necesarry modules are loaded but i am not sure i made a 
/dev/tun etc etc etc but no luck

lsmod:
Module                  Size  Used by    Tainted: GF
sheep_net               5496   0
mol                    43524   0
tun                     5216   0
isofs                  27684   0  (autoclean)
inflate_fs             18112   0  (autoclean) [isofs]
dmasound_pmac          46584   0
i2c-core               14824   0  [dmasound_pmac]
dmasound_core          13640   0  [dmasound_pmac]
soundcore               4936   3  [dmasound_core]
nfsd                   76608   8  (autoclean)
lockd                  53608   1  (autoclean) [nfsd]
sunrpc                 70724   1  (autoclean) [nfsd lockd]
af_packet              15432   2  (autoclean)
bmac                   13252   1  (autoclean)
tulip                  59996   1  (autoclean)
iptable_filter          2160   1  (autoclean)
ipt_MASQUERADE          1856   1  (autoclean)
iptable_nat            17588   1  [ipt_MASQUERADE]
ip_tables              13968   5  [iptable_filter ipt_MASQUERADE iptable_nat]
ip_conntrack           17500   1  [ipt_MASQUERADE iptable_nat]
ext3                   76300   2  (autoclean)
jbd                    53616   2  (autoclean) [ext3]
vfat                   11744   0  (autoclean)
fat                    34892   0  (autoclean) [vfat]
supermount             76804   1  (autoclean)
mesh                   17524   0  (unused)
sym53c8xx              75904   4
sd_mod                 13276   8

molrc 

#-*-makefile-*-################################################
#
#  Mac-on-Linux configuration file (molrc)
#
#  MOL looks for this resource file in the following places
#
#	/etc/molrc-hostname
#	/etc/molrc
#
#  All paths are relative /usr/share/mol.
#
###############################################################

#	First, make sure boot_method below is set appropriately. The options are
#	
#	newworld	This is most probably what you want. MOL boots directly from
#			the "Mac OS ROM" file in the system folder. The ROM file might be 
#			missing on pre-iMac machines (it is possible to use the free application
#			'tome viewer' to extract the file from the MacOS installer). 
#
#	oldworld	MOL boots MacOS using a boot-rom. Only certain old boot ROMs are
#			supported (in particular, machines similar to the PowerMac 8500
#			are supported). You probably do not want to do an oldworld
#			boot unless you have a very old version of MacOS (<= 8.5).
#
#	macosx		Boot MacOS X (or Darwin). Not yet fully working.
#
#	linux		Boot Linux. Not yet fully working.


boot_method:	newworld


####################################
# Newworld settings
####################################

#	By default, MOL loads the 'Mac OS ROM' file directly from the startup disk.
#	If this is not desirable (e.g. if the ROM happens to be incompatible and
#	it is desirable to use another version), the ROM can be loaded from linux
#	by using the newworld_rom keyword

#newworld_rom:		rom/rom.nw


####################################
# Oldworld settings 
####################################


#	The following applies to oldworld booting ONLY:
#
# 	You should in general use a ROM-image and an oftree description 
# 	file from the same machine, or from a closely related machine.
# 	If no ofree image is available (or if it doesn't work),
# 	try all the files in the oftrees directory /usr/lib/mol/oftrees.
#
# 	If the lines below are commented, then the ROM/oftree of the
# 	machine running the software will be used (see doc/mol/Status
# 	for more information)
#
#	Sometimes it might be necessary to set 'processor' below to 4.
#	(Do this only if 8 does not work)
#
#	Note: Do NOT use the "strip_nwrom" command on non-newworld images!
#

rom_image:		rom/rom.8500
oftree:			oftrees/oftree.8500


####################################
# Session save/restart (newworld only)
####################################
#
# 	By pressing F12, the MOL session can be saved to
# 	disk. The next time MOL is started, the session will be
# 	restarted (very rapidly). 

session_file:		/tmp/mol_session	# Typically has a size of 30-130 MB


####################################
# Emulation parameters
####################################
#
# 	processor values:  601, 602, 603, 604, G3 (750), G4 (7400)
#
#	In general, you should not set 'processor'. MOL will automatically
#	determine which processor model it should emulate.
#
# NOTE [603 users]
#	Run MOL in 604 mode, or preferably, in G3 mode (G3 mode is default)
#
# NOTE [boot-ROM booting]: 
#	Some boot-ROMs might not run in G3 mode. If so, try 604 mode instead.
#
# NOTE [601 users]
#	Always run in 601 mode (default)
#
# NOTE [G4 users]
# 	If the linux kernel lacks AltiVec support, it is necessary to
# 	explicitly disable the altivec unit below. MOL will probably crash if
#	this is not done. More importantly, 2.2 kernels without altivec support 
#	MIGHT PANIC DUE TO A KERNEL BUG.

#processor:		G3

ram_size:		256	# should probably be increased
disable_altivec:	no


####################################
# HFS volumes
####################################
#
# blkdev:	device	flags
#
# 	Device can for instance be /dev/hda, /dev/hda6 or /dev/sda4.
# 	The following flags are supported:
#
# 	-rw/-ro		read-write / read-only [default]
#	-force		export non-HFS partitions (be careful!)
#	-cd		CD
#	-boot		boot from this disk

blkdev:         	/dev/hda        -ro
#blkdev:         	/dev/hdb        -ro
blkdev:         	/dev/sda10      -rw
#blkdev:         	/dev/sdb        -ro
#blkdev:        	/dev/cdrom      -cd
#blkdev:        	/dev/sr0	-cd

# WARNING: 
#	Make sure you have backups of any important data before enabling 
# 	read-write permissions. Disk corruption in conjunction with
# 	MOL has been reported (most probably due to a conflict with RamDoubler 9).
#
#	You might want to change the entries above to something
# 	like 'blkdev /dev/hda6 -rw -boot'.
#
# Note 1:
#	If there is an error 'file system map inconsistent' during boot,
# 	then write privileges should be enabled (this appears to be a MacOS bug
# 	which sometimes prevents booting from a locked volume).
#
# Note 2: 
#	Which volume MacOS tries to boot from is dependent
# 	upon the order of the blkdev lines above.
#


####################################
# Mouse
####################################
#
# 	One of the following mouse settings should probably be used:
#
#	 device		protocol
#	-------------------------
#	 /dev/usbmouse,	  usb		# might work with ADB too
#	 /dev/input/mice, usb		# might work with ADB too
#	 /dev/adbmouse,	  adb
#	 /dev/mouse,	  ps2
#	     -		console		# for old kernels

#mouse_device:		/dev/input/mice
mouse_protocol:		usb		# usb (ps2), adb, console
mouse_dpi:		140
use_x_cursor:		yes		# use X cursor as mouse cursor


####################################
# Ethernet
####################################
#
# netdev:	device [-sheep | -tap | -tun]
#
#	Note: It is possible to configure up to three network 
# 	interfaces simultaneously. 
#

#netdev:	tap0 -sheep
tunconfig_script: /usr/lib/mol/bin/tunconfig
netdev: eth1  # this is for AppleTalk
netdev: tun0 -tun # this is for TCP/IP


#######################################
# Video configuration
#######################################

# Startup resolution and depth (used as a *HINT* only)
resolution:		1152/870/75		# width/height[/Hz]
depth:			15		 

# X-display to be used ($DISPLAY is used if commented)
#xdisplay:		remote.host.address:0.0

# The tool 'molvconfig' configures the fullscreen modes.

start_on_console:	yes	# switch to console initially
autoswitch_console:	yes	# allow automatic switching to console
enable_console_video:	yes	# Full-screen video is *much* faster than X-video
enable_xvideo:		no	# 
use_backing_store:	no	# Set to 'yes' only if the X-server is remote.
vt:			8	# VT-number to use for full-screen video

# For VNC information, visit http://www.uk.research.att.com/vnc/

enable_vncvideo:	no	# Enable the VNC server
vnc_port:  		5900	# port to use for VNC


####################################
# Keyboard
####################################
#
#	Almost all Apple keyboards have an unique ID, and it affects how MacOS
#	deals with key map tables and such. Unless a non-Roman script system
#	is used, modification of this ID will have no great effect.
#
#	Hint: For ADB keyboards, the ID might be printed during bootup:
#		.....
#		adb devices: [2]: 2 22 [3]: 3 1
#		       	      ^     ^
#		       	      |     +- The second number ("22" here) is the keyboard ID.
#			This "2" indicates that it's an ADB keyboard.
#
#	Sample IDs:
#
#	   1  Apple Standard Keyboard
#	   2  Apple Extended Keyboard
#	   4  Apple ISO Keyboard
#	   5  Apple Ext. ISO Keyboard II
#	  22  JIS Apple Keyboard II
#	 195  PowerBook Titanium, iBook
#	 200  JIS USB Keyboard
#

keyboard_id: 1

#	Older kernels in general use ADB keycodes. MOL tries to auto-detect
#	whether ADB or linux keycodes are used, but this setting can be forced
#	by uncommenting the following line:

#use_linux_keycodes:	yes


####################################
# Keyboard Customization
####################################

#	When a key is pressed, MOL sees its associated keycode (unfortunately,
#	the same key on different keyboard models sometimes gives different 
#	keycodes). Thus, it might be necessary to tell MOL what adbcode
#	a particular key should have (MOL uses ADB codes to represent
#	keys). To find out what adbcode a particular key should have, please
#	consult the figure 'doc/mol-0.9.XX/adbcodes.gif'.

#	It might be necessary to manually tune the keyboard mapping to get
#	it completely right.
#
#remap_key:	keycode     adbcode
#remap_xkey:	xkeycode    adbcode
#
#	remap_key affects full-screen mode while remap_xkey affects X-mode. 
#	Note that the keycode and the xkeycode for a particular key are 
#	different. To find out the keycode for a particular key, uncomment
#	the following line, start MOL, and press the key.
#
#show_key_trans:	 yes
# 
#	Instead of using multiple remap_key/remap_xkey lines, the keycodes can be 
put 
#	into a separate file. The lines should contain 'keycode: adbcode' pairs.
#
#kbd_file:	filename
#xkbd_file:	filename
#
#	Unless the following line is uncommented, MOL will try to 
#	auto-configure the keyboard (in X-mode). For U.S. keyboards (and 
#	in particular for remote-X connections), this give a good result. 
#	If a non-US keyboard layout is used, it is sometimes better to 
#	disable this feature.
#
#disable_xkey_remap:	yes


####################################
# Console video gamma
####################################
#
#	Gamma correction for the display. "gamma" takes one floating 
#	number between 0.1 and 10.0 or three floating numbers specifying
#	each R, G, and B value separately. A larger value gives a 
#	brighter display. No correction is made when the value is 1.0.
#	Please note that the xvideo mode is not affected by this setting.

gamma:		1.0			# one value for all RGB
#gamma:		1.0 1.0 1.0		# R G B separately


####################################
# Sound
####################################

play_startboing:	no		# Play startboing
disable_osi_sound:	no		# Disable sound?


####################################
# Misc
####################################

logfile:	/var/log/mol.${session}.log

tunconfig
#!/bin/bash
/sbin/ifconfig tun0 192.168.1.1
/sbin/iptables -D POSTROUTING -t nat -s 192.168.1.0/24 -d !
192.168.1.0/24 -j MASQUERADE >& /dev/null
/sbin/iptables -t nat -s 192.168.1.0/24 -d ! 192.168.1.0/24 -A
POSTROUTING -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward


startmol:
Version 0.9.63
Configuration file: /etc/molrc
Data directory: /usr/local/share/mol/0.9.63
Session 0. Lockfile '/var/lock/mol-0'
Debugger nub disabled
The session save/restore feature is disabled
OF device tree: oftrees/oftree.nw
Timebase frequency: 16.70 MHz
256MB RAM mapped at 0x40000000
Running in PowerPC G3 mode
Using Linux keycodes
Using nvram-image '/var/local/mol/nvram.nw'
Running on VT 8.
Could not open '/var/local/mol/console.kbd'
Using usb mouse on /dev/input/mice
Cache enabled for console-video
Video module 'console_video' installed.

MODE: 1152* 870, depth 15   { 0.0 } Hz

Starting in video mode 1152*870, depth 15, 0.0 Hz  [offs:2816, rb:2304]
Autoswitching to console
Failed to execute '/usr/lib/mol/bin/tunconfig': Exec format error
Ethernet Interface (port 1) 'tun-<tun0>' @ 00:00:0D:EA:DB:EE
Ethernet Interface (port 2) 'sheep-<eth1>' @ FE:FD:DE:AD:BE:EF
Using /dev/dsp for sound output

HFS  images/moldisk.i MOL                <read-only>     0 MB
HFS+ /dev/sda10       naamloos 2         <read-write>  352 MB
No volumes found in '/dev/hda'

Searching /dev/sda10 for a 'Mac OS ROM' file

**** HINT ***********************************************
*  The ROM search can be speeded up by adding the line
*    macos_rompath: 'Systeemmap/Mac OS ROM'
*  to the /etc/molrc file.
*********************************************************
Loading 'Systeemmap/Mac OS ROM' from /dev/sda10

Mapping GC at 80800000
of_canon: /pci/@d/pci-ata@1/ata-4@0/disk@0 -- ''
**** of_call_method: cmd 'get-key-map' ih: 00000001 (2/2) Args:
*** nop_'interpret' [1,2]   401007B2
************ WARNING, phandle == 0 ***********
of_open: node '//pci/pci-bridge/MacOnLinuxVideo:0' missing
extra vclaim, virt: 009B1000, size 2F000
**** of_call_method: cmd 'get-key-map' ih: 00000001 (2/2) Args:
of_open: node '/pci/@d/pci-ata@1/ata-4@0/disk@0:5,\\:bear' missing
**** of_call_method: cmd 'read' ih: 00106E10 (4/2) Args:  00000200 00116CE0
*** nop_'close' [1,0]   00106E10
Replacing old translation (EA 80816000, old-phys 0081E000)
Fixing timer calibration (0000C00A)
********* of_quiesce *********
<*> kOpenCommand
<*> control - Unrecognized cscode 20
<*> control - Unrecognized cscode 20
<*> control - Unrecognized cscode 20
<*> control - Unrecognized cscode 20
<*> DriveControlCmd IGNORED -1
<*> Gestalt selector 'ejec' skipped (unit==NULL)
<*> Gestalt selector 'ejec' skipped (unit==NULL)
cleaning up...
Terminating threads...
DONE

 this is what is did:

On Tuesday 18 June 2002 20:15, you wrote:
> Ethertap is obsolete now.  Try the tun way of networking, there are
> postings about thisCopyright (C) 1997-2002 Samuel Rydh <samuel@ibrium.se>





>
> [copy and pasted from other emails]
>
> Subject: Re: mol networking + 2.4.8
> From: Samuel Rydh <samuel@ibrium.se>
> Date: Fri, 24 Aug 2001 00:06:25 +0200
>
> There are several possibilities.
>
>
> 1. Network configuration in /etc/molrc:
>
> netdev: eth0 # this is for AppleTalk
> netdev: tun0 -tun # this is for TCP/IP
>
>
> 2. Kernel configuration:
>
> Network device support
> ======================================================================
> CONFIG_TUN (Network device support -> Universal TUN/TAP device driver
> support)
>
> Networking options
> ======================================================================
> CONFIG_NETFILTER (Networking options -> Network packet filtering)
>
> Networking options -> Netfilter Configuration:
> ======================================================================
> CONFIG_IP_NF_CONNTRACK (Connection tracking)
> CONFIG_IP_NF_IPTABLES (IP tables support)
> CONFIG_IP_NF_NAT (Full NAT)
> Some of the other options in this group is probably also needed,
> (but the default setting should be OK).
>
> I.e. this is a normal masquerading setup except for adding
> the the tun support.
>
>
> 3. Create the file /usr/lib/mol/bin/tunconfig
>
> It should look like
> ---- cut here ---
> #!/bin/bash
> /sbin/ifconfig tun0 192.168.1.1
> /sbin/iptables -D POSTROUTING -t nat -s 192.168.1.0/24 -d !
> 192.168.1.0/24 -j MASQUERADE >& /dev/null
> /sbin/iptables -t nat -s 192.168.1.0/24 -d ! 192.168.1.0/24 -A
> POSTROUTING -j MASQUERADE
> echo 1 > /proc/sys/net/ipv4/ip_forward
> --- end ----
>
> Make it executable (chmod 755 /usr/lib/mol/bin/tunconfig)
>
>
> 4. Optionally add the following to /etc/hosts (recommended):
>
> 192.168.1.0 tunnetwork
> 192.168.1.1 tun
> 192.168.1.2 tun-mol
>
>
> 5. Configure TCP/IP in MacOS:
>
> Select "Ethernet, port 1"
> IP: 192.168.1.2
> netmask: 255.255.255.0
> gateway: 192.168.1.1
> nameserver: whatever is used in linux
>
>
> 6. Configure AppleTalk in MacOS
>
> Select "Ethernet, port 2"
>
>
> 7. Optionally add the following to /etc/hosts.allow
>
> ALL: 192.168.1.2
>
>
> Some comments:
> ==============
>
> - The tun0 device can't be configured until MOL is started.
> (This is the reason why MOL calls the configuration script)
>
> - MOL must be started by root (at least for now - the
> script won't have root privileges otherwise).
>
> - It is only necessary two specify two different netdev lines
> in /etc/molrc if AppleTalk is to be used.
>
> - The configuration assumes the default policy is
> ACCEPT (can be examined by doing '/sbin/iptables -L'.
>
> - The iptables package must be installed.
>
> - Make sure there is a /dev/net/tun device.
> (Can be created with 'mkdir /dev/net ; mknod /dev/net/tun c 10 200').
>
> 	---***---
>
> From: 	Samuel Rydh <samuel@waltari.theophys.kth.se>
> Subject: 	Re: Missing resource: 'tunconfig_script'
> Date: 	16 Apr 2002 15:34:08 +0200
>
> >I just compiled and installed 0.9.62 and everything is working just
>
> fine
>
> >except for the tun interface. I copied both molrc (netdev: tun0 -tun)
>
> and
>
> >tunconfig (as posted earlier by Samuel) from my previous installation,
>
> but
>
> >as soon as I 'startmol' I get this in the log:
> >
> >---> Missing resource: 'tunconfig_script'
> >Ethernet Interface (port 1) 'tun-<tun0>' @ XX:XX:XX:XX:XX:XX
> >Ethernet Interface (port 2) 'sheep-<eth0>' @ XX:XX:XX:XX:XX:XX
> >
> >And then of course all the regular tun things doesn't work.
>
> Add the line
>
> tunconfig_script: ${bin}/tunconfig
>
> to your /etc/molrc file. This will tell MOL to run the script
> /usr/[local/]lib/mol/0.9.62/bin/tunconfig in order to
> configure tun0.
>
> 	---***---
>
> That should get you going.  Personally I put my tunconfig script in
> /usr/lib/mol/tunconfig.  This way when I update mol I don't have to make
> a new file.
>
> Hope this helps.
>
> r.May
>
> _______________________________________________
> mol-general mailing list
> mol-general@lists.maconlinux.org
> http://lists.maconlinux.org/mailman/listinfo/mol-general
any help is appreciated.
Thomas Geenen