# $Header: /project/rock-uml-orig/RCS/network.txt,v 1.4 2001/04/07 22:53:00 anders Exp $ # Anders Karlsson $Date: 2001/04/07 22:53:00 $ # # Below is a quick guide to how to get UML networking up and running # on ROCK Linux. I have tested the following procedure and it works # for me. There are caveats like permissions and ownership of # /dev/misc/net/tun to remember, but that is covered in Lennerts # HOWTO. # # $Log: network.txt,v $ # Revision 1.4 2001/04/07 22:53:00 anders # Added bits about the patches, changed bits of the ToDo. That's about # it I think. # # Revision 1.3 2001/03/25 18:44:17 anders # Updated to match against the HTML copy created. They should now be in # sync and tell the same story. (They really ought to, right?) # # Revision 1.2 2001/03/24 19:06:05 anders # Added procedure for downloading from CVS for the UML code. Added a tiny # ToDo list at the bottom. It will surely grow in time though....... # # Revision 1.1 2001/03/22 21:34:17 anders # Initial revision # # The files you need can be found at these places: # The diff for UML https://www.math.leidenuniv.nl/~buytenh/uml/net/umlnetfast2.4.2-3.diff # Same NetFast diff for UML, but for the CVS 010407 drop https://www.rocklinux.org/projects/uml/files/umlnetfast2.4.2-010407.diff # The NetFast devfs diff for UML https://www.rocklinux.org/projects/uml/files/umlnetfast-devfs.diff # The tar-ball containing the bridge code https://www.math.leidenuniv.nl/~buytenh/bridge/ # The tar-ball with the tuncfg command and the tun_patch for the # kernel. https://vtun.sourceforge.net/tun/tun.tgz # The patch for tuncfg.c to adhere to devfs path https://www.rocklinux.org/projects/uml/files/tuncfg-devfs.diff # To fetch the latest UML release via CVS, create a directory to keep # it all in, cd into the directory and do the following: cvs -d:pserver:anonymous@cvs.user-mode-linux.sourceforge.net:/cvsroot/user-mode-linux login # The password for anonymous is blank, so just press RETURN when it # asks for a password. # There are three modules to check out, they are: 'linux', 'doc' and # 'tools'. The command to check things out is as follows. cvs -z3 -d:pserver:anonymous@cvs.user-mode-linux.sourceforge.net:/cvsroot/user-mode-linux co modulename # If you do not want the hassle of CVS, go to the UML download pages # at: https://sourceforge.net/projects/user-mode-linux # where is a 'Latest File Release' section where you can get both # ready-compiled UML kernels and kernel-patches against stock kernel # trees. If you want to do a spot of DIY, get the 'kernel # patch'. Latest release on their pages is 0.39-2.4.2 from Feb., 24th # which is for the 2.4.2 kernel. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- # # The paths and commands in the following instructions reflects my own # environment, so you will have to amend it to suit your # environment. To build the correct UML executable, do the following. # cd to the project directory cd /project/UML # Extract the kernel source tar Ixf /project/sources/linux-2.4.0.tar.bz2 # Patch it to 2.4.2 bzcat /project/sources/patch-2.4.1.bz2 | patch -p0 bzcat /project/sources/patch-2.4.2.bz2 | patch -p0 # Copy in the stuff from the CVS repository cp -Rf /project/UML/cvs/linux /project/UML/ # cd into the UML kernel tree and apply the following patches patch -p1 < /project/UML/backups/umlnetfast2.4.2-3.diff # Begin Patch --- linux/arch/um/drivers/eth_user_fast.c.orig Thu Mar 22 20:38:16 2001 +++ linux/arch/um/drivers/eth_user_fast.c Thu Mar 22 20:38:24 2001 @@ -74,7 +74,7 @@ struct ifreq ifr; dprintk("do_connect [%p]\n", conn); - if ((fd = open("/dev/net/tun", O_RDWR)) < 0) { + if ((fd = open("/dev/misc/net/tun", O_RDWR)) < 0) { dprintk("do_connect 1 [%p]\n", conn); goto fail; } # End Patch # Then run these commands to create the UML executable itself. make mrproper ARCH=um cp /project/UML.config /project/UML/linux/.config make dep ARCH=um make linux ARCH=um # When finished, you have a 'linux' executable that you can copy to # your test directory. cp /project/UML/linux/linux /project/uml-test/ # # To create the correct bits in the network setup, you have to do the # following: # Extract the tun.tgz archive and apply the tun_patch to your 2.4 host # kernel tree. It will only affect your tun.o module. (TUN/TAP # device.) Recompile your modules and install them. Reboot not # required unless you have it compiled in to the kernel or did not # have it enabled at all. # Apply the following patch to tuncfg.c # Begin Patch --- tuncfg.c.orig Thu Mar 22 21:02:45 2001 +++ tuncfg.c Thu Mar 22 21:03:11 2001 @@ -23,7 +23,7 @@ { 0 } }; -#define TUN_NODE "/dev/net/tun" +#define TUN_NODE "/dev/misc/net/tun" static char *dev = NULL; static int persist = -1; # End Patch # Then compile it with gcc -o tuncfg tuncfg.c # You then need the bridge-utils-0.9.2.tar.gz archive. Extract, and # build according to instructions. You are really only after the brctl # executable. # You are now set for setting up the networking side. When you use # tuncfg, remember that the device you create has to match the # hostname in the UML you will start up, and the device in the UML you # will configure. So the hostname uml0 and the device eth0 becomes # uml0.eth0 - quite easy once you get the hang of it. :-) Also make # sure that the user running the UML has R/W permissions to # /dev/misc/net/tun. This is how I do it on my box. brctl addbr br0 brctl setfd br0 4 brctl sethello br0 1 tuncfg -e -o anders -p uml0.eth0 brctl addif br0 uml0.eth0 ifconfig br0 192.168.72.1 up ifconfig uml0.eth0 up # Boot the UML and issue the following command inside the UML, ifconfig eth0 192.168.72.10 up # And ping the Host and jump for joy as it magically works. ;-) # According to the documentation I have read, you should be able to # boot another UML and get it to talk to the Host and the first UML if # you do the following on the Host. tuncfg -e -o anders -p uml1.eth0 brctl addif br0 uml1.eth0 ifconfig uml1.eth0 up # And then in the second UML (with hostname uml1) you do the # following. ifconfig eth0 192.168.72.11 up # You should now from any of the UML's and the Host be able to ping # anyone of the others. *This is untested.* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ToDo List: o Convert this document to DVI and PS. o Tidy up this document to a more understandable level. o Whatever you others can think of and make me agree to... ;-) # # $Source: /project/rock-uml-orig/RCS/network.txt,v $ #