华为仿真模拟器与VMware虚拟机还能这样组合,简直太强大了

有时候,我在使用ensp动手做实验时在想,ensp里的网络设备能不能正常访问互联网呢?这样就可以更加真实的模拟环境。经过一番折腾,终于实现了。今天把这个案例分享给大家。

借助VMware虚拟机的NAT网卡,实现上网

安装完VMware虚拟机之后,电脑会多出现两张网卡,一张是VMnet1,一张是VMnet8。其中VMnet1是桥接模式,VMnet8是NAT模式。

华为仿真模拟器与VMware虚拟机还能这样组合,简直太强大了

eNSP绑定本地网卡,与仿真设备进行通信

eNSP工具中的云代表通过各种网络技术连接起来的计算机网络环境,目前可实现的功能包括:仿真设备之间建立映射关系、绑定网卡与仿真设备之间进行通信,以及通过开放UDP端口方式与外部程序进行通信。

1、向工作区中添加“云”,双击“云”图标,打开“云”配置界面。

2、在“端口创建”区域框中,依据连接至云的设备接口类型选择相应的“端口类型”,这里选择“VMnet8”的网卡。

华为仿真模拟器与VMware虚拟机还能这样组合,简直太强大了

前期的工作已完成,下面通过一个小案例,把知识点串联起来。

网络拓扑

华为仿真模拟器与VMware虚拟机还能这样组合,简直太强大了

拓扑中使用一台USG6000、终端PC1和一个已绑定VMnet8的云。其中云的配置请参考上文。

终端PC1配置如下:

华为仿真模拟器与VMware虚拟机还能这样组合,简直太强大了

防火墙上配置:

配置G1/0/1接口IP地址,其实G1/0/1的IP就是终端PC1的网关地址。

<code>[USG6000V1] interface GigabitEthernet1/0/1
[USG6000V1-GigabitEthernet1/0/1] ip address 192.168.1.254 255.255.255.0/<code>

配置G1/0/0接口自动获取IP地址,从VMnet8中自动获取地址。

<code>[USG6000V1]dhcp enable#全局模式使能dhcp服务
[USG6000V1] interface GigabitEthernet1/0/0
[USG6000V1-GigabitEthernet1/0/0]ip address dhcp-alloc/<code>

配置安全区域zone,把对应的接口加入到对应的zone中

<code>[USG6000V1]firewall zone trust 
[USG6000V1-zone-trust]add  interface GigabitEthernet 1/0/1 #把接口G1/0/1加入到trust中
[USG6000V1]firewall zone untrust 
[USG6000V1-zone-trust]add  interface GigabitEthernet 1/0/0  #把接口G1/0/0加入到untrust中/<code>

配置安全策略,放通local安全区域到untrust区域的策略,用于测试防火墙是否正正常上外网。

<code>[USG6000V1]security-policy
[USG6000V1-policy-security]rule name 10
[USG6000V1-policy-security-rule-10]  source-zone local
[USG6000V1-policy-security-rule-10]  destination-zone untrust
[USG6000V1-policy-security-rule-10]  action permit/<code>

此时,防火墙就可以正常的访问到互联网了,验证如下:

华为仿真模拟器与VMware虚拟机还能这样组合,简直太强大了

让终端PC1上外网,就变得相当简单了,可以采用nat的模式,使其上外网。

NAT配置步骤

1、配置NAT地址池,这个地址池要和G1/0/0接口的IP地址在同一网段。

<code>[USG6000V1]nat address-group address_1
[USG6000V1-address-group-address_1] section 0 192.168.224.142 192.168.224.143/<code>

2、配置NAT策略

<code>[USG6000V1]nat-policy
[USG6000V1-policy-nat]rule name to_Internet
[USG6000V1-policy-nat-rule-to_Internet]source-zone trust
[USG6000V1-policy-nat-rule-to_Internet]destination-zone untrust
[USG6000V1-policy-nat-rule-to_Internet]action  source-nat address-group address_1/<code>

3、配置安全策略

<code>[USG6000V1]security-policy
[USG6000V1-policy-security]rule name 20
[USG6000V1-policy-security-rule-20]  source-zone trust
[USG6000V1-policy-security-rule-20]  destination-zone untrust
[USG6000V1-policy-security-rule-20]  action permit/<code>

到此,终端PC1就可以通过NAT去访问互联网了。验证如下

华为仿真模拟器与VMware虚拟机还能这样组合,简直太强大了

我们还可以查看防火墙的会话表项的,如下图

华为仿真模拟器与VMware虚拟机还能这样组合,简直太强大了


分享到:


相關文章: