Imo this does not belong into the toh, its rather a specific qemu use case. — Jo-Philipp Wich 2011/02/28 15:32
My goal is to run a complete enterprise network into my computer, all machines running as virtual ones, even the router. This howto will explain how install openwrt on this virtual router.
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5).
# The loopback network interface auto lo iface lo inet loopback
# The primary network interface # # Create a software bridge br0, and connect eth0 (the real ethernet adapter). # Virtual machines connected to this bridge will be virtually connected to # the physical network, like eth0. # auto br0 iface br0 inet dhcp bridge_ports eth0 bridge_stp off bridge_maxwait 0
# Create the second software bridge br1, and connect the dummy0 interface. # dummy0 will never be used, but the bridge needs at least one interface. # At this time, there is no connection between br0 and br1. auto br1 iface br1 inet manual bridge_maxwait 0 bridge_ports dummy0
Create a virtual machine
uci batch «-EOF
# Configure the eth1 NIC from the virtual machine to act as a WAN port and get the IP address via DHCP set network.wan=interface set network.wan.proto=dhcp set network.wan.ifname=eth1 commit network EOF