+--------------------+
| |
| Host PC |
+--------------------+
| tap0 | tap1 | |
+--+------+----------+
| |
| |
+--+------+---+------+
wan | eth0 | eth1 | |
+-------------+------+
+-------------+ | Qemu emulate router
lan | eth2 | eth3 | |
+---+------+--+------+
| |
| |
+-----------+ | +--+---------+
| client 1 |--+ | client 2 | Qemu emulate PCs
| | | |
+-----------+ +------------+
qemu-router 之环境设计
最近想用qemu在linux下 build 一个环境,来模拟开发路由器。好处有很多,比如便于调试kernel阿,乱搞不会破坏系统阿之类的。
于是写了两个script,一个负责模拟router端,一个负责模拟客户机。整个环境配置如图: