网络基础--搭建一个简单的网络

网络基础--搭建一个简单的网络

文章目录

前言一、配置路由器二、配置服务器三、电脑开启dhcp服务总结

前言

这里用的是华为的模拟器ENSP来完成这个实验。 华为的模拟器中PC不能访问服务器,也就是说不能访问网页,所以用Client。 要求:所有电脑自动获取ip地址—dhcp服务,Client能够通过ip访问http网站,也可以通过dns域名服务,访问http网站,最后全网互联。

一、配置路由器

//用户模式只可以用来看,不能进行配置

system-view //由用户模式进入上层模式--系统模式

Enter system view, return user view with Ctrl+Z.

[huawei]

[huawei]sysname r1 //修改名字为r1

[r1]

[r1]interface GigabitEthernet 0/0/0 //进入GE0/0/0接口

[r1-GigabitEthernet0/0/0]ip address 192.168.1.254 255.255.255.0 //配置接口地址

[r1-GigabitEthernet0/0/0]quit //退出接口

[r1]interface GigabitEthernet 0/0/1 //进入GE0/0/1接口

[r1-GigabitEthernet0/0/1]ip address 192.168.2.254 255.255.255.0 //配置接口地址

[r1]display ip interface brief //查看接口信息

*down: administratively down

^down: standby

(l): loopback

(s): spoofing

The number of interface that is UP in Physical is 3

The number of interface that is DOWN in Physical is 1

The number of interface that is UP in Protocol is 3

The number of interface that is DOWN in Protocol is 1

Interface IP Address/Mask Physical Protocol

GigabitEthernet0/0/0 192.168.1.254/24 up up

GigabitEthernet0/0/1 192.168.2.254/24 up up

GigabitEthernet0/0/2 unassigned down down

NULL0 unassigned up up(s)

[r1]

[r1]dhcp enable //开启dhcp服务

[r1]ip pool name1 //创建ip地址池塘,名字叫name1,名字可以随意起名

[r1-ip-pool-name1]network 192.168.1.0 mask 255.255.255.0 //宣告该ip池塘所在的网段

[r1-ip-pool-name1]gateway-list 192.168.1.254 //网关ip地址

[r1-ip-pool-name1]dns-list 192.168.2.20 //域名服务器ip地址

[r1]interface GigabitEthernet 0/0/0

[r1-GigabitEthernet0/0/0]dhcp select global //进入GE0/0/0接口,并开启dhcp服务,华为模拟器要求必须在接口上开启dhcp服务,才可以下放ip

[r1-GigabitEthernet0/0/0]quit

[r1]interface GigabitEthernet 0/0/1

[r1-GigabitEthernet0/0/1]dhcp select global //进入GE0/0/1接口,并开启dhcp服务

注:华为模拟器中,上层模式兼容下层模式的所有命令。

二、配置服务器

服务器本质上也是一个电脑,只不过这个电脑配置较高,可以用来提供各类服务,所以叫做服务器。 1.配置ip地址 http服务器ip地址 dns服务器ip地址 点开http服务器,任意选择一个有内容的文件夹,然后直接启动就可以 点开dns服务器,任意给一个域名,提供http服务器的ip地址,增加,接着启动就可以。

三、电脑开启dhcp服务

在电脑命令行查看该电脑ip地址----ipconfig ping一下别的电脑,查看网络是否正常 ensp中的Client不支持dhcp服务,需要手配ip地址 通过IP地址访问网页 通过域名访问网页

总结

到这里,这个实验整体已经完成。

相关作品

电脑卡了如何关机 电脑关机一直卡着不动了强制关机教程
我的世界怎么瞬移2025
365bet如何提款

我的世界怎么瞬移2025

📅 06-29 👁️ 8896
北单新玩法:猜对一场就中奖,奖金丰厚到你难以想象!