「網工必備」華爲設備網絡基礎配置命令總結,收藏黨福利(下)

OSPF單區域配置

ospf 1 進入ospf視圖1代表進程號
area 0 創建區域並進入OSPF區域視圖,輸入要創建的區域ID,骨幹區域即區域0
network +IP +匹配碼
display ospf interface 命令查看OSPF接口通告是否正確、
display ospf peer 查看OSPF鄰居狀態
display ip routing-table protocol ospf 查看OSPF路由表





配置OSPF區域明文認證

ospf 1
area 1
authentication-mode simple plain huawei plain是口令以明文方式顯示
authentication-mode md5 1 huawei 配置區域密文認證



配置鏈路認證

int g0/0/1
ospf authentication-mode md5 1 huawei 在一條鏈路中的兩個接口配置要相同


3e1c10220530290141d6cfdf18c8b783.jpeg

路由引入:

ospf 1
import-route rip 1 在ospf進程中引入rip
default-route-advertise always 在ospf進程中引入默認路由

rip
import-route ospf 1 在rip進程中引入ospf
import-route ospf cost 3 ospf 引入rip時配置開銷值
default-route originate 在RIP進程中發佈默認路由



當然我還有很多整理好的資料文檔和視頻文件,【 點這裏】 獲得更多資料文檔 往期教學視頻,主要也是想給新手小白少走點彎路。

vrrp(虛擬路由器冗餘協議)基本配置

int g0/0/0
vrrp vrid 1 virtual-ip 172.16.1.254 創建VRRP備份組,備份組號爲1,配置虛擬IP爲172.16.1.254
vrrp vrid 1 priority 120 修改優先級爲120
display vrrp 查看vrrp信息
display vrrp brief
display vrrp interface g0/0/0 查看VRRP的工作狀態





配置VRRP多備份組

int g0/0/0
vrrp vrid 1 virtual-ip 172.16.1.254 創建VRRP備份組,備份組號爲1,配置虛擬IP爲172.16.1.254
vrrp vrid 1 priority 120 修改優先級爲120
vrrp vrid 2 virtual-ip 172.16.1.253 創建VRRP備份組,備份組號爲2,配置虛擬IP爲172.16.1.253


int g0/0/0
vrrp vrid 1 virtual-ip 172.16.1.254 創建VRRP備份組,備份組號爲1,配置虛擬IP爲172.16.1.254
vrrp vrid 2 virtual-ip 172.16.1.253 創建VRRP備份組,備份組號爲2,配置虛擬IP爲172.16.1.253
vrrp vrid 2 priority 120 修改優先級爲120


vrrp vrid 2 preempt-mode disable 開啓非搶佔方式


配置VRRP的跟蹤接口及認證

int g0/0/1
vrrp vrid 1 track interface GigabitEthernet 0/0/0 reduced 50 監視上行接口G0/0/0,當此接口斷掉時,裁減優先級50,使優先級爲70
vrrp vrid 1 authentication-mode md5 huawei 認證配置


配置基本的訪問控制表

acl 2000 創建一個編號型ACL,基本ACL的範圍是2000~29999
rule 5 permit source 1.1.1.1 0 指定規則ID爲5,允許數據源地址爲1.1.1.1的報文通過,反掩碼全爲0,即精確匹配
rule 10 deny source any 指定ID爲10,拒絕任意源地址的數據包通過

display acl all 查看設備上所有的訪問控制列表


37ea86f0600edd97f960d50285fe1935.jpeg

ppp的PAP認證配置

int Serial 4/0/0
undo ppp authentication-mode 刪除以前的pap配置
去到另一端
undo ppp pap local-user 刪除ppp本地用戶
回到配置路由器
int Serial 4/0/0
authentication-mode CHAP 配置ppp認證模式爲CHAP
aaa 進入aaa視圖
loacal-user R1 password cipher huawei 用戶設置爲R1,密碼設置爲huawei
loacal-user R1 service-type ppp 設置服務類型爲ppp
去到另外一端配置用戶名和密碼
int Serial 4/0/0
ppp chap user R1
ppp chap password cipher huawei













幀中繼配置

int Serial 1/0/0
link-protocol fr 修改鏈路協議
fr inarp 開啓逆向地址解析功能
fr map 10.1.1.1 201 配置一條靜態地址映射
dis fr pvc-info 查看PVC的建立情況




配置基於接口地址池DHCP

(動態主機配置協議)
[R1]dhcp enable 路由器上開啓DHCP
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]dhcp select interface 開啓接口DHCP功能
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]dhcp select interface
[R1-GigabitEthernet0/0/0]dhcp server lease day 2 配置DHCP服務器接口地址池中IP地址的租用有效期限爲兩天
[R1-GigabitEthernet0/0/0]dhcp server excluded-ip-address 192.168.1.1 192.168.1.10 設置不參與分配自動分配的IP地址範圍
[R1-GigabitEthernet0/0/1]dhcp server dns-list 8.8.8.8 配置該接口地址池下的DNS服務器爲PC分配DNS服務器地址
[R1]display ip pool 查看DHCP地址池中的地址分配情況









配置基於全局地址池的DHCP

[R1]dhcp enable
[R1]ip pool huawei1 創建一個全局地址池
[R1-ip-pool-huawei1]network 192.168.1.0 命令配置全局地址池huawei1可動態分配的網段範圍爲192.168.1.0,默認使用24爲掩碼。
[R1-ip-pool-huawei1]lease day 2 配置DHCP全局地址池下的地址租期爲2天
[R1-ip-pool-huawei1]gateway-list 192.168.1.254 配置dhcp客戶端的出口網關地址
[R1-ip-pool-huawei1]excluded-ip-address 192.168.1.250 192.168.1.253 禁止分配這個範圍的地址
[R1-ip-pool-huawei1]dns-list 8.8.8.8 配置DNS服務地址
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]dhcp select global 開啓DHCP功能採用全局地址池爲客戶端分配地址








配置DHCP中繼

方法一直接指定DHCP服務器
[R1]dhcp enable 路由器開啓DHCP功能
[R1]interface g0/0/1
[R1-GigabitEthernet0/0/1]dhcp select relay 開啓DHCP中繼功能
[R1-GigabitEthernet0/0/1]dhcp relay server-ip 100.1.1.1 指定DHCP服務器
方法二全局配置DHCP中繼:
[R1]dhcp server group dhcp-group 創建DHCP服務器組dhcp-group
[R1-dhcp-server-group-dhcp-group]dhcp-server 100.1.1.1 配置DHCP服務器






[R1-dhcp-server-group-dhcp-group]int g0/0/1
[R1-GigabitEthernet0/0/1]dhcp select relay 開啓DHCP中繼功能
[R1-GigabitEthernet0/0/1]dhcp relay server-select dhcp-group 將接口加入到DHCP服務器組dhcp-group


ipv6基礎配置

[R1]ipv6 開啓全局開啓開啓IPv6
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ipv6 enable 在接口下開啓IPv6功能
[R1-GigabitEthernet0/0/0]ipv6 address auto link-local 接口上配置自動生成的鏈路本地地址
用EUI-64方式配置IPv6地址
[R1]int g 0/0/0
[R1]ipv6 address 2001:3:FD:: 64 eui-64






40970f6221e8ce7da1fca98d8fbdee21.jpeg


配置NAT Easy — IP

[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]undo nat outbound 2001 address-group 1 no-pat 刪除之前的配置
[R1-GigabitEthernet0/0/0]nat outbound 2001 配置Easy-IP特性,直接使用接口IP地址作爲NAT轉換後的地址


配置nat server

[R1-GigabitEthernet0/0/0]interface g0/0/0
[R1-GigabitEthernet0/0/0]nat server protocol tcp global 202.169.10.6 ftp inside 172.16.1.3 ftp 定義內部服務器的映射表,指定服務器通信類型爲tcp,配置服務器使用公網IP地址爲202.169.10.6,服務器內網地址爲172.16.1.3,指定端口號爲21用關鍵字ftp代替
[R1]nat alg ftp enable 開啓ftp功能

當然我還有很多整理好的資料文檔和視頻文件,【 點這裏】 獲得更多資料文檔 往期教學視頻,主要也是想給新手小白少走點彎路。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章