Skip to contentSkip to conversation

Virtual Interface

lartc list user 2 participants 2 messages Feb 3, 2006 – Feb 7, 2006

lore
Share & tools
lore

list user

author
#0 lore raw

Hi Roger,

[big snip: lost o.p.]

There are a couple of different approaches you might try. One is to use
uml-utilities' tunctl to create an ethernet tap. Another is to use the
dummy interface. With either method you can bridge, route, configure as you would a physical device using ifconfig and/or ip.

The following methods work for me. I use Fedora Core 4. Its network setup methods are in /etc/sysconfig/network-scripts.

cd /etc/sysconfig/network-scripts
ln -s ifup-eth ifup-tap
ln -s ifdown-eth ifdown-tap
echo 'ip link show tap0 | grep "tap0" 2>&1 >/dev/null || tunctl -t tap0 DEVICE=tap0
TYPE=ethernet
ONBOOT=yes
BOOTPROTO=static
MACADDRZ:5a:5a:5a:5a:5a
NETWORK2.168.0.0
IPADDR2.168.0.1
BROADCAST2.168.0.255
NETMASK%5.255.255.0' > ifcfg-tap0
ifup tap0

ln -s ifup-eth0 ifup-dummy
ln -s ifdown-eth ifdown-dummy
echo 'ip link show dummy0 | grep "dummy0" 2>&1 >/dev/null || {
ip link set dummy0 up
ip link set dummy0 arp on
ip link set dummy0 multicast on
}
DEVICE=dummy0
TYPE=ethernet
ONBOOT=yes
BOOTPROTO=static
MACADDR¤:a5:a5:a5:a5:a5
NETWORK2.168.0.0
IPADDR2.168.0.2
BROADCAST2.168.0.255
NETMASK%5.255.255.0' > ifcfg-dummy0
ifup dummy0

If all went well there should now be two new virtual ethernet devices, tap0 and dummy0.

Hope this information is useful to you,
Mike Wright :m)

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#1 lore raw

Mike,

Thanks. I will try it..
I have not explained the puspose for this doing this - just to give you an idea I want to create around 200 virtual interfaces and send traffice through all the interfaces simulating traffic comming from different networks. Do you think this approach will scale to that level?

Roger

Quoted 49 lines · list user

Hi Roger,

[big snip: lost o.p.]

There are a couple of different approaches you might try. One is to use
uml-utilities' tunctl to create an ethernet tap. Another is to use the
dummy interface. With either method you can bridge, route, configure as you would a physical device using ifconfig and/or ip.

The following methods work for me. I use Fedora Core 4. Its network setup methods are in /etc/sysconfig/network-scripts.

cd /etc/sysconfig/network-scripts
ln -s ifup-eth ifup-tap
ln -s ifdown-eth ifdown-tap
echo 'ip link show tap0 | grep "tap0" 2>&1 >/dev/null || tunctl -t tap0 DEVICE=tap0
TYPE=ethernet
ONBOOT=yes
BOOTPROTO=static
MACADDR=5a:5a:5a:5a:5a:5a
NETWORK=192.168.0.0
IPADDR=192.168.0.1
BROADCAST=192.168.0.255
NETMASK=255.255.255.0' > ifcfg-tap0
ifup tap0

ln -s ifup-eth0 ifup-dummy
ln -s ifdown-eth ifdown-dummy
echo 'ip link show dummy0 | grep "dummy0" 2>&1 >/dev/null || { ip link set dummy0 up
ip link set dummy0 arp on
ip link set dummy0 multicast on
}
DEVICE=dummy0
TYPE=ethernet
ONBOOT=yes
BOOTPROTO=static
MACADDR=a4:a5:a5:a5:a5:a5
NETWORK=192.168.0.0
IPADDR=192.168.0.2
BROADCAST=192.168.0.255
NETMASK=255.255.255.0' > ifcfg-dummy0
ifup dummy0

If all went well there should now be two new virtual ethernet devices, tap0 and dummy0.

Quoted 8 lines

Hope this information is useful to you,
Mike Wright :m)

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc