From: Marcus B. <Mar...@ep...> - 2003-01-21 18:05:04
|
Hi there. I think I found a logical error in how the setuid helper 'uml_net' configur= es=20 tap devices and routes. Let me first explain the setup I'd like to have: Physical Host: IP: 192.168.1.10/24 on ethernet Virtual Hosts: outer tap end IP, inner tap end IP (ARP-published) IP: 192.168.1.11, 192.168.1.12 IP: 192.168.1.13, 192.168.1.14 IP: 192.168.1.15, 192.168.1.16 etc.. There is be no problem in setting this up manually (at least I remember hav= ing=20 it working months ago without fuzz), however when I try to simplify this by= =20 using the uml_net helper it breaks. This is what the docs propose about usi= ng=20 uml_net automatically on the kernel command line: eth0=3Dtuntap,,,192.168.1.12 This leads to the following being executed: * ifconfig tap0 192.168.1.12 netmask 255.255.255.255 up * bash -c echo 1 > /proc/sys/net/ipv4/ip_forward * route add -host 192.168.1.12 dev tap0 * bash -c echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp * arp -Ds 192.168.1.12 eth0 pub The docs for manual tap device configuration propose the use of a different= IP=20 address for the outer tap end thus leading to a differing 'ifconfig' line.= =20 How does this fit? If I use the uml_net approach, how do I setup the=20 routes/addresses inside the virtual host? Thanks for your time, Marcus Software: Standard Debian Woody packages -> uml-utilities 20020415-3 -> user-mode-linux 2.4.18.17um-1 |
From: Jan H. <bu...@uc...> - 2003-01-22 08:31:40
|
On Tue, Jan 21, 2003 at 07:04:56PM +0100, Marcus Blomenkamp wrote: > Hi there. > > I think I found a logical error in how the setuid helper 'uml_net' configures > tap devices and routes. Let me first explain the setup I'd like to have: > > Physical Host: > IP: 192.168.1.10/24 on ethernet > > Virtual Hosts: outer tap end IP, inner tap end IP (ARP-published) > IP: 192.168.1.11, 192.168.1.12 > IP: 192.168.1.13, 192.168.1.14 > IP: 192.168.1.15, 192.168.1.16 > etc.. > > There is be no problem in setting this up manually (at least I remember having > it working months ago without fuzz), however when I try to simplify this by > using the uml_net helper it breaks. This is what the docs propose about using > uml_net automatically on the kernel command line: > eth0=tuntap,,,192.168.1.12 > > This leads to the following being executed: > * ifconfig tap0 192.168.1.12 netmask 255.255.255.255 up > * bash -c echo 1 > /proc/sys/net/ipv4/ip_forward > * route add -host 192.168.1.12 dev tap0 > * bash -c echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp > * arp -Ds 192.168.1.12 eth0 pub > > The docs for manual tap device configuration propose the use of a different IP > address for the outer tap end thus leading to a differing 'ifconfig' line. > How does this fit? If I use the uml_net approach, how do I setup the > routes/addresses inside the virtual host? All these commands were executed on the HOST. The device inside UML must still be configured manualy. I does not do anything wrong. WAIT! Tou are passing the command wrong. It's the HOST address to be on the command line, NOT the uml address. The uml address is given using ifconfig from inside UML and when the interface is configured, uml_net configures the tap on the host. So the command line should read: eth0=tuntap,,,192.168.1.11 ^ Here is what I get: + ifconfig lo 127.0.0.1 + ifconfig eth0 192.168.1.253 netmask 255.255.255.255 up * insmod tun Using /lib/modules/2.4.19/kernel/drivers/net/tun.o * ifconfig tap0 192.168.1.254 netmask 255.255.255.255 up * bash -c echo 1 > /proc/sys/net/ipv4/ip_forward * route add -host 192.168.1.253 dev tap0 * bash -c echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp * arp -Ds 192.168.1.253 eth0 pub * arp -Ds 192.168.1.253 eth0 pub * route del -host 192.168.1.253 dev tap0 * bash -c echo 0 > /proc/sys/net/ipv4/conf/tap0/proxy_arp * arp -i eth0 -d 192.168.1.253 pub * arp -i eth0 -d 192.168.1.253 pub SIOCDARP(pub): No such file or directory * route add -host 192.168.1.253 dev tap0 * bash -c echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp + route add -host 192.168.1.254 eth0 + route add default gw 192.168.1.254 eth0 The lines presfixed with + are executed in UML (there is set -x in my rc file) and the lines prefixed with * are executed on the host by uml_net. For me the arp commands are superfluous (I have a gateway set in my routing tables), but for you they should be correct. Could someone tell me, why the uml_net sets everything up, down and up again...? ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bu...@uc...> |
From: Marcus B. <Mar...@ep...> - 2003-01-22 09:37:46
|
Am Mittwoch, 22. Januar 2003 09:31 schrieb Jan Hudec: > > WAIT! Tou are passing the command wrong. It's the HOST address to be on > the command line, NOT the uml address. The uml address is given using > ifconfig from inside UML and when the interface is configured, uml_net > configures the tap on the host. > > So the command line should read: eth0=3Dtuntap,,,192.168.1.11 > ^ > > Here is what I get: > > + ifconfig lo 127.0.0.1 > + ifconfig eth0 192.168.1.253 netmask 255.255.255.255 up > * insmod tun > Using /lib/modules/2.4.19/kernel/drivers/net/tun.o > * ifconfig tap0 192.168.1.254 netmask 255.255.255.255 up ^ > * bash -c echo 1 > /proc/sys/net/ipv4/ip_forward > * route add -host 192.168.1.253 dev tap0 > * bash -c echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp > * arp -Ds 192.168.1.253 eth0 pub > * arp -Ds 192.168.1.253 eth0 pub > * route del -host 192.168.1.253 dev tap0 > * bash -c echo 0 > /proc/sys/net/ipv4/conf/tap0/proxy_arp > * arp -i eth0 -d 192.168.1.253 pub > * arp -i eth0 -d 192.168.1.253 pub > SIOCDARP(pub): No such file or directory > * route add -host 192.168.1.253 dev tap0 > * bash -c echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp > + route add -host 192.168.1.254 eth0 > + route add default gw 192.168.1.254 eth0 > > The lines presfixed with + are executed in UML (there is set -x in my rc > file) and the lines prefixed with * are executed on the host by uml_net. How come that on the host 'ifconfig tap0' is called with the address=20 192.168.1.254/32? I suppose it is deduced from calling 'ifconfig eth0' insi= de=20 UML with address 192.168.1.253/32. But whats the rule connecting those=20 values? n+1? And what about the 192.168.1.11 you've given on the command line? I've not= =20 seen this value again in any of the following statemets? BTW: I finally got ethernet bridging working nicely. No more fuzz with rout= es=20 and ARP tables :-). And again the docs are quite unsorted and uninformative= =20 on why each command is necessary (and many are superfluous!). iproute rulez= =20 over ifconfig crap ;-) Thx anyway, Marcus |
From: Jan H. <bu...@uc...> - 2003-01-22 09:48:08
|
On Wed, Jan 22, 2003 at 10:37:34AM +0100, Marcus Blomenkamp wrote: > Am Mittwoch, 22. Januar 2003 09:31 schrieb Jan Hudec: > > > > WAIT! Tou are passing the command wrong. It's the HOST address to be on > > the command line, NOT the uml address. The uml address is given using > > ifconfig from inside UML and when the interface is configured, uml_net > > configures the tap on the host. > > > > So the command line should read: eth0=tuntap,,,192.168.1.11 > > ^ > > > > Here is what I get: > > > > + ifconfig lo 127.0.0.1 > > + ifconfig eth0 192.168.1.253 netmask 255.255.255.255 up > > * insmod tun > > Using /lib/modules/2.4.19/kernel/drivers/net/tun.o > > * ifconfig tap0 192.168.1.254 netmask 255.255.255.255 up > ^ > > > * bash -c echo 1 > /proc/sys/net/ipv4/ip_forward > > * route add -host 192.168.1.253 dev tap0 > > * bash -c echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp > > * arp -Ds 192.168.1.253 eth0 pub > > * arp -Ds 192.168.1.253 eth0 pub > > * route del -host 192.168.1.253 dev tap0 > > * bash -c echo 0 > /proc/sys/net/ipv4/conf/tap0/proxy_arp > > * arp -i eth0 -d 192.168.1.253 pub > > * arp -i eth0 -d 192.168.1.253 pub > > SIOCDARP(pub): No such file or directory > > * route add -host 192.168.1.253 dev tap0 > > * bash -c echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp > > + route add -host 192.168.1.254 eth0 > > + route add default gw 192.168.1.254 eth0 > > > > The lines presfixed with + are executed in UML (there is set -x in my rc > > file) and the lines prefixed with * are executed on the host by uml_net. > > How come that on the host 'ifconfig tap0' is called with the address > 192.168.1.254/32? I suppose it is deduced from calling 'ifconfig eth0' inside > UML with address 192.168.1.253/32. But whats the rule connecting those > values? n+1? No! The address for tap0 is deduced from the kernel command line. My command line says eth0=tuntap,,,192.168.1.254 (among tons of other things). > And what about the 192.168.1.11 you've given on the command line? I've not > seen this value again in any of the following statemets? ... I have not. You should have had. > BTW: I finally got ethernet bridging working nicely. No more fuzz with routes > and ARP tables :-). And again the docs are quite unsorted and uninformative > on why each command is necessary (and many are superfluous!). iproute rulez > over ifconfig crap ;-) My experience with ethernet bridging is, that it is CPU hungry. So unless you need broadcasts, routing tables with gateway specifications or proxy_arp are better for me. (We had brigeing of three 10Mbit interfaces running on old 486 and it ate 50% CPU. It wouldn't be much on a new computer, but every cycle is good.) ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bu...@uc...> |
From: Marcus B. <Mar...@ep...> - 2003-01-22 10:39:10
|
Am Mittwoch, 22. Januar 2003 10:47 schrieb Jan Hudec: > > No! The address for tap0 is deduced from the kernel command line. My > command line says eth0=3Dtuntap,,,192.168.1.254 (among tons of other > things). Ah, silly me.... You are absolutely right. In that way it all makes sense. Sorry I mixed up= =20 your commands referring to me and the output of your site-specific commands. > My experience with ethernet bridging is, that it is CPU hungry. So > unless you need broadcasts, routing tables with gateway specifications > or proxy_arp are better for me. (We had brigeing of three 10Mbit > interfaces running on old 486 and it ate 50% CPU. It wouldn't be much on > a new computer, but every cycle is good.) This is a point worth considering. Remebering the old 486 times you probabl= y=20 used linux<=3D2.2 and ethertap right? Ethertab invokes some userspace actio= n on=20 each transmitted packet. In contrast TUN/TAP on linux-2.4 (which I tried)=20 does not. So I expect way less overhead. Admittedly I never measured it... cu Marcus |
From: Jan H. <bu...@uc...> - 2003-01-22 10:51:35
|
On Wed, Jan 22, 2003 at 11:39:06AM +0100, Marcus Blomenkamp wrote: > This is a point worth considering. Remebering the old 486 times you probably > used linux<=2.2 and ethertap right? Ethertab invokes some userspace action on > each transmitted packet. In contrast TUN/TAP on linux-2.4 (which I tried) > does not. So I expect way less overhead. Admittedly I never measured it... No, the old 486 was replaced by a slightly newer pentium some month's ago. It's a router between physical interfaces (the old one used to have 4 10Mbit ehternets, 3 of them in a bridge, now it has 5 interfaces, some 10Mbit, some 100Mbit, but now it does not bridge). And since no tap (neither ether, nor tun) were involved, it was just kernel (the load was "system" - no process involved). Two ISA interfaces were involved, that generate some load themselves (you know, ISA does not have bus mastering), but turning of bridgind made at least 30% difference (I don't recall exactly, I am not an admin). It may be that lot more packets must be inspected (those interfaces were all 10Base2 (coax) segments, and when bridging, the card is in promiscuous mode). ------------------------------------------------------------------------------- Jan 'Bulb' Hudec <bu...@uc...> |