Penguin
Annotated edit history of MinixNotes version 3, including all changes. View license author blame.
Rev Author # Line
1 AlastairPorter 1 Notes relating to the [Minix] Operating System.
2
3 !!! Setting up networking in Minix using tuntap.
4 For some reason you may want to run Minix on some emulation software and get networking support. Here are some ways you can do it:
5
2 AlastairPorter 6 !! [Bochs]
1 AlastairPorter 7 Add this to your bochsrc(5):
8 <verbatim>
9 ne2k: ioaddr=0x240, irq=9, mac=fe:fd:00:00:00:01, ethmod=tuntap, ethdev=/dev/net/tun, script=/path/to/tunconfig
10 </verbatim>
11
12 When installing Minix, tell it to install the ne2k networking driver.
13
14 You can change the IP address of your Minix install with:
15 <verbatim>
16 ifconfig -I /dev/ip -h 192.168.1.1
17 </verbatim>
18 And everything should just work
2 AlastairPorter 19
20 !! [Qemu]
21 Load qemu like this:
22 <verbatim>
23 $ qemu -boot c -hda c.img -net nic,model=ne2k_pci -net tap,ifname=tap0,script=/path/to/tunconfig
24 </verbatim>
25 When installing Minix, tell it to install the ne2k networking driver.
26
27 Qemu seems to provide a different address/IRQ for the ne2k, you need to tell Minix to look in the correct place.
28 Edit the file /usr/etc/rc.local and replace
29 <verbatim>
30 dp8390_arg='DPETH0=240:9'
31 </verbatim>
32 with
33 <verbatim>
34 dp8390_arg='DPETH0=c100:10'
35 </verbatim>
36
37 You can get the address/IRQ by going to the Qemu console (Ctrl-Alt-2) and typing 'info pci'
38
39 Apparently it is possible to get networking going without jumping through all these hoops by using the network card option '4' in the Minix setup program. I haven't managed to get that working.
40
41 !!! External internet
42 After you can ping your tap0 device on your host, you can allow your guest to access the internet:
43 <verbatim>
44 # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
45 # echo "1" >/proc/sys/net/ipv4/ip_forward
46 </verbatim>
47
48 !!! tunconfig
49 This shell script looks something like:
50 <verbatim>
51 #!/bin/bash
52 /sbin/ifconfig ${1##/*/} 192.168.1.1
53 </verbatim>
3 AlastairPorter 54
55 !!! Setting up IP Addresses manually.
56 (Mostly from http://www.minixtips.com/2006/06/minix-with-static-ip-address.html)
57
58 Unless you have a dhcpd serving addresses out on your tun device, you probably want to do something like this to stop you having to set up the IP address each time you load minix:
59
60 Add the following to /etc/rc.net
61 <verbatim>
62 ifconfig -I /dev/ip0 -n 255.255.255.0 -h 192.168.1.2
63 add_route -g 192.168.1.1
64 </verbatim>
65
66 Add DNS by adding:
67 <verbatim>
68 your.name.server %nameserver
69 </verbatim>
70 to /etc/hosts