测试平台:
Thinkpad R60
RHEL5
dynagen 0.10.1.090807
dynamips 0.2.8-RC2-x86
1>安装bridge-utils
#rpm -ivh bridge-utils-1.1-2.i386.rpm
warning: bridge-utils-1.1-2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2
Preparing... ########################################### [100%]
1:bridge-utils ########################################### [100%]
#brctl
Usage: brctl [commands]
commands:
addbr <bridge> add bridge
delbr <bridge> delete bridge
addif <bridge> <device> add interface to bridge
delif <bridge> <device> delete interface from bridge
setageing <bridge> <time> set ageing time
setbridgeprio <bridge> <prio> set bridge priority
setfd <bridge> <time> set bridge forward delay
sethello <bridge> <time> set hello time
setmaxage <bridge> <time> set max message age
setpathcost <bridge> <port> <cost> set path cost
setportprio <bridge> <port> <prio> set port priority
show show a list of bridges
showmacs <bridge> show a list of mac addrs
showstp <bridge> show bridge stp info
stp <bridge> {on|off} turn stp on/off
2>配置文件:
[[router rta]]
model = 2691
slot1 = NM-4T
f0/0 = NIO_tap:tap0
s1/0 = rtb s1/0
3>运行dynagen,tap0在dynagen运行起来后就被自动创建了。
4>建立接口绑定:
#brctl addbr br0
#brctl addif br0 eth0
#brctl addif br0 tap0
5>配置接口:
#ifconfig tap0 up
#ifconfig eth0 0.0.0.0 up
#ifconfig br0 192.168.1.99 255.255.255.0
6>在dynagen启动相应虚拟设备:
=> start rta
7>测试:
rta#sh run int f0/0
Building configuration...
Current configuration : 97 bytes
!
interface FastEthernet0/0
ip address 192.168.1.91 255.255.255.0
duplex auto
speed auto
end
rta#ping 192.168.1.99
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.99, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/8 ms
rta#
本文出自 “SENSE” 博客,转载请与作者联系!