GNS3中的pc机怎样用?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了GNS3中的pc机怎样用?相关的知识,希望对你有一定的参考价值。

GNS3中的pc机怎样用?要下载bin文件吗?我在GNS3中拉不出pc出来的?

GNS3中PC有QENU和VirtualBox两种虚拟机,首先本机上要装有虚拟机,然后点GNS3的菜单上Edit->Preferebnces配置,QEMU需要镜像,VirtualBox需要将自己装好的虚拟机连上去:

VirtualBox如下


host和cloud则使用本机的虚拟网卡,虚拟网卡在计算机设备管理中,添加过时硬件,选lookback网卡,重启后就能在拉出的host和cloud中的config中找到这张网卡,添加进去,路由器就能连接这个网卡了。

参考技术A 直接用台路由器就能当PC用 加条 no ip routing 就变成PC啦

在GNS3做单臂路由实验

在GNS3做单臂路由实验
如图所示:
技术图片

用路由器模拟PC,R2模拟PC1,R3模拟PC2,R4模拟PC3。配置如下:
PC1:
R2#conf t
R2(config)#int f0/0
R2(config-if)#ip add
R2(config-if)#ip address 192.168.1.1 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#ip default-gateway 192.168.1.254 (配置PC网关)
R2(config)#no ip routing
R2(config)#end
R2#

PC2:
R3#conf t
R3(config)#int f0/0
R3(config-if)#ip address 192.168.2.1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#no ip routing
R3(config)#ip default-gateway 192.168.2.254(配置PC网关)
R3(config)#end
R3#

PC3:
R4#
R4#conf t
R4(config)#int f0/0
R4(config-if)#ip address 192.168.3.1 255.255.255.0
R4(config-if)#no sh
R4(config-if)#exit
R4(config)#
R4(config)#no ip routing
R4(config)#ip default-gateway 192.168.3.254(配置PC网关)
R4(config)#end
R4#

ESW1:
ESW1#
ESW1#vlan database
ESW1(vlan)#vlan 10 name vlan10
VLAN 10 added:
Name: vlan10
ESW1(vlan)#vlan 20 name vlan20
VLAN 20 added:
Name: vlan20
ESW1(vlan)#vlan 30 name vlan30
VLAN 30 added:
Name: vlan30
ESW1(vlan)#exit
APPLY completed.
Exiting....
ESW1#conf t
ESW1(config)#int f1/0
ESW1(config-if)#switchport mode access
ESW1(config-if)#switchport access vlan 10(把端口加入vlan 10)
ESW1(config-if)#no sh
ESW1(config-if)#exit
ESW1(config)#int f1/1
ESW1(config-if)#switchport mode access
ESW1(config-if)#switchport access vlan 20(把端口加入vlan 20)
ESW1(config-if)#no shutdown
ESW1(config-if)#exit
ESW1(config)#interface f1/2
ESW1(config-if)#switchport mode access
ESW1(config-if)#switchport access vlan 30(把端口加入vlan 30)
ESW1(config-if)#no shutdown
ESW1(config-if)#exit
ESW1(config)#int f1/3
ESW1(config-if)#no sh
ESW1(config-if)#switchport mode trunk
ESW1(config-if)#switchport trunk encapsulation dot1q(二层端口封装802.1q协议(dot1q),也就是trunk链路的中继协议)
ESW1(config-if)#end
ESW1#

R1:
R1#conf t
R1(config)#int f0/0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#int f0/0.1(进入子端口)
R1(config-subif)#ip address 192.168.1.254 255.255.255.0
R1(config-subif)#no sh
R1(config-subif)#encapsulation dot1Q 10(路由器配置了dot1q中继封装,10是vlan 10)
R1(config-subif)#exit
R1(config)#int f0/0.2(进入子端口)
R1(config-subif)#ip address 192.168.2.254 255.255.255.0
R1(config-subif)#encapsulation dot1Q 20(路由器配置了dot1q中继封装,20是vlan 20)
R1(config-subif)#no sh
R1(config-subif)#exit
R1(config)#int f0/0.3(进入子端口)
R1(config-subif)#ip address 192.168.3.254 255.255.255.0
R1(config-subif)#encapsulation dot1Q 30(路由器配置了dot1q中继封装,30是vlan 30)
R1(config-subif)#no shutdown
R1(config-subif)#exit
R1(config)#end
R1#

验证一下:
R2#ping 192.168.1.254(ping 网关)

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/12/24 ms
R2#ping 192.168.2.1(ping PC2)

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/28 ms
R2#ping 192.168.3.1(ping PC3)

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/28 ms
R2#

R3#ping 192.168.2.254(ping 网关)

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/11/24 ms
R3#ping 192.168.1.1(ping PC1)

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/24/32 ms
R3#ping 192.168.3.1(ping PC3)

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/22/32 ms
R3#

R4#ping 192.168.3.254(ping 网关)

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.254, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/12/32 ms
R4#ping 192.168.1.1 (ping PC1)

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/22/40 ms
R4#ping 192.168.2.1(ping PC2)

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/20/36 ms
R4#

以上是关于GNS3中的pc机怎样用?的主要内容,如果未能解决你的问题,请参考以下文章

在GNS3中模拟交换机和PC

Trunk实验

单臂路由的实验

交换机的基本实操与GNS3软件应用

GNS3 C3640路由器模仿PC机和交换机

静态路由实验2台主机+2太路由器互联互通