文章目錄
- 視圖
- 命令
- 搭建一個簡單的網路
- 搭建http服務
- 搭建DNS決議域名服務
- 搭建DHCP服務器
視圖
<Huawei> #用戶視圖 只能看配置資訊,不能進行配置操作
<Huawei>system-view #使用這個命令進入全域配置視圖
[Huawei] #全域類配置的視圖
[Huawei]interface GigabitEthernet 0/0/0 #使用這個命令進入0/0/0介面視圖
[Huawei-GigabitEthernet0/0/0] #介面視圖
命令
CTRL+Z 切回用戶視圖
display ip interface brief 顯示路由器介面簡單的資訊
sysname Huawei 更改設備名,必須進入系統視圖才可以修改
ip address 192.168.1.1 255.255.255.0 配置網關
q 退出當前視圖,進入上一級
undo ip 192.168.1.1 洗掉該條配置
display this 查看當前視圖配置資訊
display current-configuration 查看當前路由器快取中的配置資訊
save 將配置資訊存入閃存,必須在用戶視圖下進行操作,斷電就不會丟失資訊了
display saved-configuration 查看當前閃存中的配置資訊
reset saved-configuration 重置組態檔
搭建一個簡單的網路

配置IP順序
先給網關配
給路由器的兩個介面配ip
<Huawei>system-view #進入系統視圖
Enter system view, return user view with Ctrl+Z.
[Huawei]interface GigabitEthernet 0/0/0 #進入0號介面
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.1 255.255.255.0 #給0號介面配ip
[Huawei-GigabitEthernet0/0/0]
Sep 9 2021 22:58:27-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]q #退出0號介面
[Huawei]interface GigabitEthernet 0/0/1 #進入1號介面
[Huawei-GigabitEthernet0/0/1]ip address 192.168.2.1 24 #給1號介面配ip
Sep 9 2021 23:00:19-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[Huawei-GigabitEthernet0/0/1]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.1/24 up up #0號介面已經通了
GigabitEthernet0/0/1 192.168.2.1/24 up up #1號介面已經通了
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
[Huawei-GigabitEthernet0/0/1]

點開PC4
PC>ping 192.168.1.2 #ping另一個廣播域可以通
Ping 192.168.1.2: 32 data bytes, Press Ctrl_C to break
From 192.168.1.2: bytes=32 seq=1 ttl=127 time=63 ms
From 192.168.1.2: bytes=32 seq=2 ttl=127 time=15 ms
From 192.168.1.2: bytes=32 seq=3 ttl=127 time=63 ms
From 192.168.1.2: bytes=32 seq=4 ttl=127 time=78 ms
From 192.168.1.2: bytes=32 seq=5 ttl=127 time=47 ms
--- 192.168.1.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 15/53/78 ms
PC>ping 192.168.2.3 #ping同一個廣播域也通
Ping 192.168.2.3: 32 data bytes, Press Ctrl_C to break
From 192.168.2.3: bytes=32 seq=1 ttl=128 time=32 ms
From 192.168.2.3: bytes=32 seq=2 ttl=128 time=31 ms
From 192.168.2.3: bytes=32 seq=3 ttl=128 time=31 ms
From 192.168.2.3: bytes=32 seq=4 ttl=128 time=31 ms
From 192.168.2.3: bytes=32 seq=5 ttl=128 time=32 ms
--- 192.168.2.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 31/31/32 ms
搭建http服務

在http服務器上:

在Client上:

搭建DNS決議域名服務

域名決議流程:
我的電腦會先去查本地域名服務器(遞回),能不能查到,能查到,就給我,不能查到:本地域名服務器就會去找(迭代),先找根域名服務器,找不到,就告訴本地服務器一個地址,然后本地服務器又去找頂級域名服務器,找不到,就告訴本地域名服務器,然后本地域名服務器又去找權限域名服務器,最后找到了,然后就告訴了我的電腦

在和Client一個域內,新建一個服務器,用來做DNS決議



在Client端:寫入DNS決議服務器的地址

測驗:

決議成功!
搭建DHCP服務器

把路由器作為DHCP服務器,在上面進行如下配置:
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]dhcp enable #開啟dhcp服務
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]ip pool pool_one #創建一個名叫pool_one地址池
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-pool_one]network 192.168.1.0 mask 24 #給pool_one地址池放入地址
[Huawei-ip-pool-pool_one]gateway-list 192.168.1.1 #配置網關
[Huawei-ip-pool-pool_one]dns-list 114.114.114.114 8.8.8.8 #配置dns
[Huawei-ip-pool-pool_one]q
[Huawei]ip pool pool_two #創建第二個名叫pool_two的地址池
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-pool_two]network 192.168.2.0 mask 24 #填入地址范圍
[Huawei-ip-pool-pool_two]gateway-list 192.168.2.1 #網關
[Huawei-ip-pool-pool_two]dns-list 144.144.144.144 8.8.8.8 #dns
[Huawei-ip-pool-pool_two]q
[Huawei]interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]dhcp select global #dhcp選擇埠
[Huawei-GigabitEthernet0/0/0]q
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]dhcp select global #dhcp選擇埠
在pc1上測驗:
打開dhcp:


成功!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/299268.html
標籤:其他
上一篇:沒有網就不能和女朋友開視頻了?有Python在!沒網照樣開視頻!
下一篇:銳捷校園網連接路由器免認證
