You could use tuntap, which is compiled into the UML kernels:
Code:
# install uml-utilities, which has the "tunctl" admin app:
apt-get install uml-utilities
# make the dev node, and make it world read/write-able, for non-root users (adjust to suit)
mkdir /dev/net/
mknod /dev/net/tun c 10 200
chmod 666 /dev/net/tun
Example usage:
Code:
li-20:~# tunctl --help
tunctl: invalid option -- -
Create: tunctl [-u owner] [-t device-name] [-f tun-clone-device]
Delete: tunctl -d device-name [-f tun-clone-device]
li-20:~# tunctl -u caker -t caker0
Set 'caker0' persistent and owned by uid 1000
li-20:~# ifconfig caker0 192.168.1.2
li-20:~# ifconfig caker0
caker0 Link encap:Ethernet HWaddr 00:FF:C9:2A:40:FC
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2ff:c9ff:fe2a:40fc/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:3 overruns:0 carrier:0
collisions:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
li-20:~#
-Chris