GNS3配置dhcp环境


一、配置说明

GNS3版本:2.2.40.1


二、创建拓扑图

在这里插入图片描述

图中包含一台msf攻击机,一台带有漏洞的靶机,二者用交换机连接。在最上面有一个路由器。

配置msf机器和靶机为dbcp

在这里插入图片描述
将dhcp相关内容放开(去掉#注释)。

#
# This is a sample network config, please uncomment lines to configure the network
#

# Uncomment this line to load custom interface files
# source /etc/network/interfaces.d/*

# Static config for eth0
#auto eth0
#iface eth0 inet static
#	address 192.168.0.2
#	netmask 255.255.255.0
#	gateway 192.168.0.1
#	up echo nameserver 192.168.0.1 > /etc/resolv.conf

# DHCP config for eth0
auto eth0
iface eth0 inet dhcp
#	hostname metasploit-framework-1

三、配置路由

路由开启后,依次输入以下内容。

R1#conf t
#配置0/0的端口
R1(config)#interface e0/0
R1(config-if)#ip address 192.168.10.254 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#ip dhcp pool net1
R1(dhcp-config)#network 192.168.10.0
R1(dhcp-config)#dns-server 8.8.8.8
R1(dhcp-config)#default-router 192.168.10.254
R1(dhcp-config)#exit

最后,如果在重启后依旧保持路由器为dhcp而不重置,还需要输入下面的指令。

R1#wirte memory

这里可以先查看一下刚刚配置的0/0端口。

R1#show ip interface brief

在这里插入图片描述
然后就能够在机器中看到效果了。

猜你喜欢

转载自blog.csdn.net/qq_40579464/article/details/131514984