From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3096bd910608190759h372c09c8m83d830915f02b98@mail.gmail.com> Date: Sat, 19 Aug 2006 16:59:07 +0200 From: "Rodolfo (kix)" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] err 2: arena creation time after last write time In-Reply-To: <44E692D6.8060108@lanl.gov> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_16227_10916114.1155999547919" References: <3096bd910608180440o216712c4i68a577245469ff92@mail.gmail.com> <3e1162e60608180745p50fb2980n5747f90855e4f255@mail.gmail.com> <3096bd910608181728o3fd07611l893af021333be219@mail.gmail.com> <44E692D6.8060108@lanl.gov> Topicbox-Message-UUID: a42075aa-ead1-11e9-9d60-3106f5b1d025 ------=_Part_16227_10916114.1155999547919 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thanks Ronald, This is my new method ;-) and I can use ping :-) If any thinks is ok, I can write it in the wiki. slds. - - - - - - - - Installing Plan9 network for QEMU (Linux) Do you need: * Support for tunneling in kernel, with 802.1q: tun: "Network device support" -> "Universal TUN/TAP device driver support" bridging: "Networking options" -> "802.1d Ethernet Bridging" * The bridge-utils package First, load the Tunneling kernel support as modules add "tun" to /etc/modules Load it now (do not reboot ;-)): modprobe tun * Create this script: darky:~# cat kixconf IFACE=3Deth0 BRIF=3Dbr0 IPORIG=3D`/sbin/ifconfig $IFACE | grep "inet addr" | cut -d: -f2 | cut -d" = " -f1` IPGW=3D`netstat -nr | grep ^"0.0.0.0" | awk -F" " '{print $2} '` IPBCAST=3D`/sbin/ifconfig $IFACE | grep "Bcast" | cut -d: -f3 | cut -d" " -= f1` echo "Interface =3D " $IFACE echo "Bridge if =3D " $BRIF echo "IP =3D " $IPORIG echo "Gateway =3D " $IPGW echo "Broadcast =3D " $IPBCAST ifconfig $IFACE down brctl addbr $BRIF ifconfig $IFACE 0.0.0.0 promisc up ifconfig $BRIF $IPORIG netmask 255.255.255.0 broadcast $IPBCAST up brctl stp $BRIF off brctl setfd $BRIF 1 brctl sethello $BRIF 1 brctl addif $BRIF $IFACE route add default gw $IPGW darky:~# Now, configure /etc/qemu-ifup, and set the +x bit (chmod 755 /etc/qemu-ifup= ) like this: darky:~# ls -l /etc/qemu-ifup -rwxr-xr-x 1 root root 60 2006-08-19 12:57 /etc/qemu-ifup darky:~# cat /etc/qemu-ifup #!/bin/sh ifconfig $1 0.0.0.0 promisc up brctl addif br0 $1 darky:~# Now, you can use your Plan9 as a physical node in your network, then configure the Plan9 scripts as http://plan9.bell-labs.com/wiki/plan9/Network_configuration/index.html For boot the Plan 9 you shoud use this command: /usr/bin/qemu -m 128 -hda '' -net nic,vlan=3D0,macaddr=3D00:11:22:33:44:55 = -net tap,vlan=3D0,ifname=3D -localtime & slds. 2006/8/19, Ronald G Minnich : > > here's how I run qemu so as to get things going. This allows me to > drawterm into it. > > qemu qemu.vesaroot & > > Gets me a cpu kernel going > > sleep 5 && dhcpd -d > > gets me the dhcpd > > a run looks like this: > > [root@q plan9]# qemu qemu.vesaroot & sleep 5&& dhcpd -d > [1] 4674 > Connected to host network interface: tun1 > Could not open '/dev/kqemu' - QEMU acceleration layer not activated > Internet Systems Consortium DHCP Server V3.0.2-RedHat > Copyright 2004 Internet Systems Consortium. > All rights reserved. > For info, please visit http://www.isc.org/sw/dhcp/ > Wrote 0 deleted host decls to leases file. > Wrote 0 new dynamic host decls to leases file. > Wrote 17 leases to leases file. > Listening on LPF/tun1/46:9c:6d:94:f5:1f/172.20.0/24 > Sending on LPF/tun1/46:9c:6d:94:f5:1f/172.20.0/24 > > No subnet declaration for ath0 (192.168.0.104). > ** Ignoring requests on ath0. If this is not what > you want, please write a subnet declaration > in your dhcpd.conf file for the network segment > to which interface ath0 is attached. ** > > Sending on Socket/fallback/fallback-net > DHCPDISCOVER from 52:54:00:12:34:56 via tun1 > DHCPOFFER on 172.20.0.2 to 52:54:00:12:34:56 via tun1 > Dynamic and static leases present for 172.20.0.2. > Remove host declaration qemu or remove 172.20.0.2 > from the dynamic address pool for 172.20.0/24 > DHCPREQUEST for 172.20.0.2 (172.20.0.1) from 52:54:00:12:34:56 via tun1 > DHCPACK on 172.20.0.2 to 52:54:00:12:34:56 via tun1 > > > (note the DHCPREQUEST -- that's my plan 9) > (the error message is unimportant) > > OK, what's the config look like? dhcpd.conf: > subnet 172.20.0.0 netmask 255.255.255.0 { > range 172.20.0.2 172.20.0.2 ; > default-lease-time 600; > max-lease-time 7200; > option subnet-mask 255.255.255.0; > option routers 172.20.0.1; > } > host qemu { > hardware ethernet 52:54:00:12:34:56; > fixed-address xtest; > } > > xtest is (from /etc/hosts): > 172.20.0.2 xtest > > > ok but how did tun1 get configured? You need to set up /etc/qemu-ifup > > [root@q etc]# cat /etc/qemu-ifup > #!/bin/sh > tun=3D$1 > sudo /sbin/ifconfig $1 172.20.0.1 > sudo /sbin/iptables -N nat > sudo /sbin/iptables -t nat -F > sudo /sbin/iptables -t nat -A POSTROUTING -s 172.20.0.1 -j MASQUERADE > sudo /sbin/iptables -t nat -A POSTROUTING -d 172.20.0.1 -o $tun > sudo echo 1 > /proc/sys/net/ipv4/ip_forward > [root@q etc]# > > > this allows me to drawterm into the plan 9 cpu server running on my > laptop. > > If this all works, then put it in the wiki :-) This is on FC4. > > ron > --=20 Rodolfo Garc=EDa "kix" ------=_Part_16227_10916114.1155999547919 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thanks Ronald,

This is my new method ;-) and I can use ping :-)
I= f any thinks is ok, I can write it in the wiki.

slds.

- - - -= - - - -

Installing Plan9 network for QEMU (Linux)

Do you nee= d:

* Support for tunneling in kernel, with 802.1q:

tun: "N= etwork device support" -> "Universal TUN/TAP device driver sup= port"
bridging: "Networking options" -> "802.1d Ethernet Bridging"

* The bridge-utils package

First, lo= ad the Tunneling kernel support as modules

add "tun" to /etc/modules

Load it now (do= not reboot ;-)):=20 modprobe tun

* Create this= script:

darky:~# cat kixconf
IFACE=3Deth0
BRIF=3Dbr0
IPORIG=3D`/sbin/ifconfig $IFACE | grep = "inet addr" | cut -d: -f2 | cut -d" " -f1`
IPGW=3D`netstat -nr | grep ^" 0.0.0.0" | awk -F" " '{print $2} '`

IPBCAST=3D`/sbin/ifconfig $IFACE | grep "Bca= st" | cut -d: -f3 | cut -d" " -f1`

echo "Interface =3D " $IFACE
echo "Bridge if =3D " $BRIF
echo "IP =3D " $IPORIG
echo "Gateway =3D " $IPGW
echo "Broadcast =3D " $IPBCAST

ifconfig $IFACE down
brctl addbr $BRIF
ifconfig $I= FACE 0.0.0.0 promisc up
ifconfig $BRIF $IPORIG netmask 255.255.255.0 broadcast $IPBCAST up
brctl stp $BRIF off
brctl s= ethello $BRIF 1
brctl addif $BRIF $IFACE
route add default gw $IPGW
darky:~#

Now, configure /etc/qemu-ifup, and set the +x bit (chm= od 755 /etc/qemu-ifup) like this:

darky:~# ls -l /etc/qemu-ifup
-rwxr-xr-x 1 root root 60 2006-08-= 19 12:57 /etc/qemu-ifup
darky:~# cat /etc/qemu-ifup
#!/bin/sh
ifconfig $1 0.0.0.0 promisc up
brctl addif br0 $1

darky:~#
<= br>Now, you can use your Plan9 as a physical node in your network, then configure the Plan9 scripts as http://plan9.bell-labs.com/wiki/plan9/Network_configuration/index.h= tml

For boot the Plan 9 you shoud use this command:

/usr/bin/qemu -m 128 -hda '' -net nic,vlan=3D0,macaddr=3D00:11:22:33:44:55 = -net tap,vlan=3D0,ifname=3D -localtime &


slds.

2006/8/19, Ronald G Minnich < rminnich@lanl.gov>:
here's how I run qemu so as to get things going. This allow= s me to
drawterm into it.

qemu qemu.vesaroot &

Gets me a cpu = kernel going

sleep 5 && dhcpd -d

gets me the dhcpd
a run looks like this:

[root@q plan9]# qemu qemu.vesaroot &= sleep 5&& dhcpd -d
[1] 4674
Connected to host network interface: tun1
Could not open= '/dev/kqemu' - QEMU acceleration layer not activated
Internet Systems C= onsortium DHCP Server V3.0.2-RedHat
Copyright 2004 Internet Systems Cons= ortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Wrote 0 deleted host dec= ls to leases file.
Wrote 0 new dynamic host decls to leases file.
Wro= te 17 leases to leases file.
Listening on LPF/tun1/46:9c:6d:94:f5:1f/172.20.0/24
Sending on =   LPF/tun1/46:9c:6d:94:f5:1f/172.20.0/24

No subnet declaration = for ath0 (192.168.0.104).
** Ignori= ng requests on ath0.  If this is not what
    you want, please write a subnet declaration
=     in your dhcpd.conf file for the network segment
=     to which interface ath0 is attached. **

Send= ing on   Socket/fallback/fallback-net
DHCPDISCOVER from 52:54:= 00:12:34:56 via tun1
DHCPOFFER on 172.20.0.2 to 52:54:00:1= 2:34:56 via tun1
Dynamic and static leases present for 172.20.0.2.
Remove host declaration qemu or remove 172.20.0.2
from the dynamic address pool for 172.20.0/24
DHCPREQU= EST for 172.20.0.2 (172.20.0.1) from 52:54:00:12:34:56 via tun1
DHCPACK on 172.20.0.2 to 52:54:00:12:34:56 via tun1


(note the DHCPREQUE= ST -- that's my plan 9)
(the error message is unimportant)

OK, wh= at's the config look like? dhcpd.conf:
subnet 172.20.0.0 netmask 255.255.255.0 {=
            = ;   range 172.20.0.2 172.20.0.2 ;
      = ;         default-lease-time 600;
            = ;      max-lease-time 7200;
  &n= bsp;            opti= on subnet-mask 255.255.255.0;
 = ;            &n= bsp;   option routers 172.20.0.1;
           &nb= sp; }
host qemu {
         hardwar= e ethernet 52:54:00:12:34:56;
       =   fixed-address xtest;
}

xtest is (from /etc/hosts):
172.20.0.2 xtest


ok but how did tu= n1 get configured? You need to set up /etc/qemu-ifup

[root@q etc]# cat /etc/qemu-ifup
#!/bin/sh
tun=3D$1
sudo /= sbin/ifconfig $1 172.20.0.1
sudo /sbin= /iptables -N nat
sudo /sbin/iptables -t nat -F
sudo /sbin/iptables -t= nat -A POSTROUTING -s=20 172.20.0.1 -j MASQUERADE
sudo /sbin/ip= tables -t nat -A POSTROUTING -d 172.20.0.1 -o $tun
sudo echo 1 > /proc/sys/net/ipv4/ip_forward
[root@q etc]= #


this allows me to drawterm into the plan 9 cpu server running o= n my laptop.

If this all works, then put it in the wiki :-) This is = on FC4.

ron



--
Rodolfo Garc=EDa "kix" ------=_Part_16227_10916114.1155999547919--