两极人生,八度空间

Fight for my CISSP and PMP

首页 新随笔 联系 聚合 管理
  156 Posts :: 22 Stories :: 67 Comments :: 0 Trackbacks

首先,需要下载好openvpn-2.0.9-install.exe和将putty拷贝到c:\windows\system32下面。在安装openvpn后会在开始菜单的程序下面的OPENVPN目录下有"add a new TAP virtual ethernet adapter"和“delete all TAP virtual ethernet adapter”选项,每次点击“add a new TAP virtual ethernet adapter”,就会生成一块tap网卡。在pix实验中我们需要四个口,一个管理口,一个inside口,一个dmz口,一个Outside口。

模拟PIX使用的pemu,下载好pemu后,编辑里面的pix.bat这个批处理文件,这个文件是模拟pix的拓扑文件。根据要模拟的接口,我们一起看看这个批处理文件如何写。

d:
cd\pemu
pemu.exe -net nic,macaddr=00:aa:00:00:02:01 -net tap,ifname=tap0 -net nic,macaddr=00:aa:00:00:02:02 -net tap,ifname=tap1 -net nic,macaddr=00:aa:00:00:02:03 -net tap,ifname=tap2  -net nic,macaddr=00:aa:00:00:02:04 -net tap,ifname=tap3 -serial telnet::4001,server,nowait

 

d:表明,你的pemu是放在本机的d盘,这个你可以随你改。在这个文件中,分别有ifname=tap0,tap1,tap2,tap3,那么我们对应的用openvpn去生成tap0,tap1,tap2,tap3这四块虚拟网卡。

那么如何将PIX的e0口桥接到我们的本机的物理网卡上,将tap1桥接到PIX的inside口即E1口,将tap2桥接到PIX的outside即E2口,将tap3桥接到PIX的dmz即E3口,E3跟DMZ中的虚拟的server连接。

这里我们采用两个16口的ethernet switch模块。分别接在tap1和tap2上。

获取tap1,tap2的网卡参数,等下要用,分别如:tap1--- \Device\NPF_{F0E1E387-1E93-43E5-8CB0-CCC4E74B01DA}

tap2---\Device\NPF_{BC348114-5216-449F-B732-FDB02E159AF8


   [[ethsw ethsw1]]
    1 = dot1q 2
    9 = access 2 NIO_gen_eth:\Device\NPF_{F0E1E387-1E93-43E5-8CB0-CCC4E74B01DA}  tap1的网卡参数
   10 = access 2 NIO_gen_eth:\Device\NPF_{BC348114-5216-449F-B732-FDB02E159AF8}    tap2的网卡参数
   [[ethsw ethsw2]]
    1 = dot1q 3
    9 = access 3 NIO_gen_eth:\Device\NPF_{5E9BC9EB-EEA6-4CBC-B2DC-3E66742B9314} 本机物理网卡参数

面对下面的一个拓扑,我们将怎样写net文件呢?


net文件如下:

autostart = false

[visual-server]
port = 7200
udp = 10000
workingdir = D:\Netemu Labs\secemu\Dynamips\temp

    {3640}
    image = D:\Netemu Labs\IOS\c3640-js-mz.124-10.bin
    ram = 128
    confreg = 0x2102
    idlepc =  0x60593c70
    exec_area = 64
    mmap = false

    {3620}
    image = D:\Netemu Labs\IOS\c3620-i-mz.122-37.bin
    ram = 32
    confreg = 0x2102
    idlepc =  0x60452190
    exec_area = 32
    mmap = false

    [[router SW]]   
    model = 3640
    console = 3001 
    slot0 = NM-4T
    slot1 = NM-16ESW
    F1/0 = ethsw1 1
    f1/1 = PCGL f0/0
    f1/2 = PCCW f0/0
    f1/3 = PCQT f0/0
    f1/4 = ethsw1 2
    [[router RT]]   
    model = 3620
    console = 3002  
    slot0 = NM-1FE-TX
    f0/0 = ethsw2 1

    [[router PCGL]]   
    model = 3620
    console = 3003   
    slot0 = NM-1FE-TX

    [[router PCCW]]   
    model = 3620
    console = 3004  
    slot0 = NM-1FE-TX

    [[router PCQT]]   
    model = 3620
    console = 3005   
    slot0 = NM-1FE-TX
 

   [[ethsw ethsw1]]
    1 = dot1q 2
    9 = access 2 NIO_gen_eth:\Device\NPF_{F0E1E387-1E93-43E5-8CB0-CCC4E74B01DA}
   10 = access 2 NIO_gen_eth:\Device\NPF_{BC348114-5216-449F-B732-FDB02E159AF8}
   [[ethsw ethsw2]]
    1 = dot1q 3
    9 = access 3 NIO_gen_eth:\Device\NPF_{5E9BC9EB-EEA6-4CBC-B2DC-3E66742B9314}

 

DMZ里的server我是用VMware虚拟的。server桥接到dmz,在VM的网卡参数设置中选择如下所示:

在Host Virtual Networking Mapping tab中,为VMnet0选择网卡如图中的tap3。那么你的VM虚拟的这台SERVER就桥接到PIX的DMZ上了。桥接到具体情况,请看我给出的示意图如下:

e0接管理PC,即我的本地主机。e1接inside,e2接outside,e3接dmz。VM虚拟的server桥接在tap3上。

 

posted on 2008-12-27 14:04 Jerome 阅读(1027) 评论(1)  编辑 收藏 引用 所属分类: Network simulators

Feedback

# re: PIX实验中如何将PIX的接口桥接到相应的TAP网卡 2009-01-01 22:35 painting
找到 了  回复  更多评论
  

只有注册用户登录后才能发表评论。