[Simh] Networking Tricks...

David Holland david.w.holland at gmail.com
Mon Oct 4 18:11:10 EDT 2010


I stumbled across a vaguely useful trick to do my SIMH network, that,
doesn't involve a 2nd physical network interface, nor does it involve
a 2nd level user-land process. (aka: taptap)

# ip link add name veth0 type veth peer name veth1
# ifconfig veth0 up
# ifconfig veth1 up

And the following in VAX.INI

; Attach Ethernet to a network interface
set xq mac=08-00-2B-AA-BB-CC
attach xq veth1

Packets written to veth1, show up on veth0, and vice versa. (aka:
taptap, except kernel level, and accordingly no user/kernel context
switches.)

Apparently its a device type, called VETH, added in newer kernels.
http://lwn.net/Articles/232688/
I found them on my Fedora 13 and Ubuntu 9.10 images, but the devices
don't exist in my Centos 5.5 image.

You can then do the "usual" bridging tricks to attach veth0 to the
local LAN, with a single interface.

# brctl show br0
bridge name	bridge id		STP enabled	interfaces
br0		8000.00044b155730	no		eth0
							veth0

# ifconfig br0
br0       Link encap:Ethernet  HWaddr 00:04:4b:15:57:30
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::204:4bff:fe15:5730/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1123428 errors:0 dropped:0 overruns:0 frame:0
          TX packets:678405 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1201987824 (1.2 GB)  TX bytes:3680295206 (3.6 GB)

# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:04:4b:15:57:30
          inet6 addr: fe80::204:4bff:fe15:5730/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3444300 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1995726 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4148911351 (4.1 GB)  TX bytes:2278845621 (2.2 GB)
          Interrupt:26 Base address:0x6000

# ifconfig veth0
veth0     Link encap:Ethernet  HWaddr ca:5d:97:4d:c2:f6
          inet6 addr: fe80::c85d:97ff:fe4d:c2f6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:536 errors:0 dropped:0 overruns:0 frame:0
          TX packets:524 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:285375 (285.3 KB)  TX bytes:45167 (45.1 KB)

# ifconfig veth1
veth1     Link encap:Ethernet  HWaddr 2a:e0:6c:f4:47:af
          inet6 addr: fe80::28e0:6cff:fef4:47af/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:527 errors:0 dropped:0 overruns:0 frame:0
          TX packets:548 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:45305 (45.3 KB)  TX bytes:293468 (293.4 KB)

[uholld1 at quest ~]$ ping defeat
PING defeat.localdomain.home (192.168.0.201) 56(84) bytes of data.
64 bytes from defeat.localdomain.home (192.168.0.201): icmp_seq=0
ttl=64 time=10.5 ms

(You'll have to trust me that 'quest' is a completely separate
(virtual) Linux image, and 'defeat' is the name of the VAX)

One other bit of trivia is custom interface names:

# ip link add name VAXeth0 type veth peer name VAXeth1

Works as well.

Hopefully someone will find this of vague use......

David



More information about the Simh mailing list