[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Trouble getting uml networking going.



On Sat, 2003-07-05 at 20:35, Manoj Srivastava wrote:
> Hi,
> 
>         I am getting various errors trying to set up user-mode-linux
>  networking on a 2.4 kernel, running Debian Sid. I have documented
>  what happened when trying the preconfigured tun/tap configuration. 
> 
> 	I have a machine with a simple routing tablee, and a single
>  nic with ip 192.168.1.10. I am trying to set up tap0 with the host
>  end having an IP address of 192.168.1.14; and assign 192.168.1.16 to
>  the uml.
> 
> 	Here is what I did initially as root:
> ----------------------------------------------------------------------
> __> route
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> localnet        *               255.255.255.0   U     0      0        0 eth0
> default         tiamat.green-gr 0.0.0.0         UG    0      0        0 eth0
> __> route -n
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
> 192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
> 0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
> __> ifconfig eth0
> eth0      Link encap:Ethernet  HWaddr 00:E0:18:96:5B:EC  
>           inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:1943612 errors:1 dropped:0 overruns:0 frame:2
>           TX packets:2029820 errors:0 dropped:0 overruns:0 carrier:615
>           collisions:10184 txqueuelen:100 
>           RX bytes:1110590037 (1.0 GiB)  TX bytes:816650307 (778.8 MiB)
>           Interrupt:17 Base address:0xa400 
> 
> __> tunctl -u 1000
> Set 'tap0' persistent and owned by uid 1000
> __> ifconfig tap0 192.168.1.14 up
> __> echo 1 > /proc/sys/net/ipv4/ip_forward 
> __> route add -host 192.168.1.16 dev tap0
> __> echo 1> /proc/sys/net/ipv4/conf/tap0/arp_filter 
> __> arp -Ds 192.168.1.16 eth0 pub
> __> chmod 666 /dev/net/tun
> __> echo uml halted now
> uml halted now
> __> tunctl -d tap0
> Set 'tap0' nonpersistent
> __> exit
> ----------------------------------------------------------------------

Curiously, I never had to touch this. I used root only for apt-get and
adduser ..

> 	This next is the script when I ran the uml with the command
>  line option: % linux root_fs eth0=tuntap,,,192.168.1.14. Please note
>  that as the kernel is booting, it recognizes a net device:
>     Netdevice 0 : TUN/TAP backend - IP = 192.168.1.14
> 
> 	But note the following errors:
> Configuring network interfaces... tuntap_open_tramp failed - errno = 22
> SIOCSIFFLAGS: Invalid argument
> tuntap_open_tramp failed - errno = 22
> SIOCSIFFLAGS: Invalid argument
> done.
> 
> 
> 
> ______________________________________________________________________
> 	Running dmesg inside the uml seems to point to a failure to
>  run uml_net.
> 
> 
> ______________________________________________________________________
> 	What am I doing wrong? Is this a bug in uml_net?
> 
> 	manoj


Two things that strike me are that uml_net's default permissions require
you to be root, or in group uml-net .. and uml_net performs the tun/tap
configuration itself - I'm not sure if the route already existing would
be enough to break uml_net when it tries to do it itself.

FWIW, the command I use to start uml is:

screen -L -S $UMLID -d -m kernel-2.4.20-6um \
ubd0=woody.ext3 eth0=tuntap,,,192.168.1.120 \  
devfs=nomount root=/dev/ubd0 mem=32M umid=woody \
con=null con0=fd:0,fd:1

where 192.168.1.120 is my NIC's IP (ie, the host, not the uml)

And follows a transcript of bootup & shutdown. I believe the lines
starting with an asterix (*) are executed on the host by uml_net, and I
note I have a line reading "Universal TUN/TAP device driver 1.5
(C)1999-2002 Maxim Krasnyansky" that didn't appear in yours.
(I did compile the uml kernel myself, but didn't change anything from
the default)

Regards,
  Shaun


Checking for the skas3 patch in the host...not found
Checking for /proc/mm...not found
tracing thread pid = 25712
Linux version 2.4.20-6um (shaun@brian) (gcc version 2.95.4 20011002
(Debian prerelease)) #1 Thu Jun 12 10:22:42 EDT 2003
On node 0 totalpages: 16384
zone(0): 16384 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: ubd0=/var/uml/fs/woody.ext3
eth0=tuntap,,,192.168.1.120 devfs=nomount root=/dev/ubd0 mem=64M
umid=woody con=null con0=fd:0,fd:1
Calibrating delay loop... 824.02 BogoMIPS
Memory: 61724k available
Dentry cache hash table entries: 8192 (order: 4, 65536 bytes)
Inode cache hash table entries: 4096 (order: 3, 32768 bytes)
Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 16384 (order: 4, 65536 bytes)
Checking for host processor cmov support...Yes
Checking for host processor xmm support...No
Checking that ptrace can change system call numbers...OK
Checking that host ptys support output SIGIO...Yes
Checking that host ptys support SIGIO on close...No, enabling workaround
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
VFS: Diskquotas version dquot_6.4.0 initialized
Journalled Block Device driver loaded
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x0
pty: 256 Unix98 ptys configured
SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256).
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
PPP generic driver version 2.4.2
Universal TUN/TAP device driver 1.5 (C)1999-2002 Maxim Krasnyansky
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Initializing software serial port version 1
mconsole (version 2) initialized on /home/shaun/.uml/woody/mconsole
Partition check:
 ubda: unknown partition table
UML Audio Relay (host dsp = /dev/sound/dsp, host mixer =
/dev/sound/mixer)
Initializing stdio console driver
Netdevice 0 : TUN/TAP backend - IP = 192.168.1.120
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 4096 bind 4096)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.

INIT: version 2.84 booting

Activating swap.
Checking root file system...
fsck 1.27 (8-Mar-2002)
/dev/ubd0: clean, 11346/131072 files, 98503/524288 blocks
EXT3 FS 2.4-0.9.19, 19 August 2002 on ubd(98,0), internal journal
System time was Sun Jul  6 08:09:35 UTC 2003.
Setting the System Clock using the Hardware Clock as reference...
hwclock is unable to get I/O port access:  the iopl(3) call failed.
System Clock set. System local time is now Sun Jul  6 08:09:35 UTC 2003.
Calculating module dependencies... depmod: Can't open
/lib/modules/2.4.20-6um/modules.dep for writing
done.
Loading modules: 
modprobe: Can't open dependencies file
/lib/modules/2.4.20-6um/modules.dep (No such file or directory)
Checking all file systems...
fsck 1.27 (8-Mar-2002)
Setting kernel variables.
Mounting local filesystems...
nothing was mounted
Running 0dns-down to make sure resolv.conf is ok...done.
Cleaning: /etc/network/ifstate.
Setting up IP spoofing protection: rp_filter.
Configuring network interfaces:
* insmod tun
insmod: a module named tun already exists
Using /lib/modules/2.4.21-ck1-20030615/kernel/drivers/net/tun.o
* ifconfig tap0 192.168.1.120 netmask 255.255.255.255 up
* bash -c echo 1 > /proc/sys/net/ipv4/ip_forward
* route add -host 192.168.1.205 dev tap0
* bash -c echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp
* arp -Ds 192.168.1.205 eth0 pub
done.

Setting the System Clock using the Hardware Clock as reference...
hwclock is unable to get I/O port access:  the iopl(3) call failed.
System Clock set. Local time: Sun Jul  6 08:09:40 UTC 2003

Cleaning: /tmp /var/lock /var/run.
Initializing random number generator... done.
Recovering nvi editor sessions... done.

INIT: Entering runlevel: 2

Starting system log daemon: syslogd.
Starting kernel log daemon: klogd.
Starting internet superserver: inetd.
Starting OpenBSD Secure Shell server: sshd.
Starting deferred execution scheduler: atd.
Starting periodic command scheduler: cron.

INIT: Switching to runlevel: 0

INIT: Sending processes the TERM signal
INIT: Sending processes the KILL signal

Stopping periodic command scheduler: cron.
Stopping internet superserver: inetd.
Stopping OpenBSD Secure Shell server: sshd.
Saving the System Clock time to the Hardware Clock...
hwclock is unable to get I/O port access:  the iopl(3) call failed.
Hardware Clock updated to Sun Jul  6 08:10:06 UTC 2003.
Stopping deferred execution scheduler: atd.
Stopping kernel log daemon: klogd.
Stopping system log daemon: syslogd.
Sending all processes the TERM signal... done.
Sending all processes the KILL signal... done.
Saving random seed... done.
Unmounting remote filesystems... done.
Deconfiguring network interfaces:
* route del -host 192.168.1.205 dev tap0
* bash -c echo 0 > /proc/sys/net/ipv4/conf/tap0/proxy_arp
* arp -i eth0 -d 192.168.1.205 pub
done.
Deactivating swap... done.
Unmounting local filesystems... done.
Power down.






Reply to: