1、計算機命令:【基於linux系統下的相關命令】前端
2、交換機命令linux
3、路由器命令服務器
3.1靜態路由網絡
3.2動態路由app
4、擴展訪問控制列表配置命令:負載均衡
4.1標準格式:less
4.2配置TCP/UDP協議的擴展訪問列表:dom
4.3配置ICMP協議的擴展訪問列表:tcp
4.4擴展訪問控制列表操做符的含義:ide
4.5擴展訪問控制列表舉例:
5、地址轉換配置舉例
5.1內部服務器地址轉換配置命令(靜態nat):
6、PPP:
7、幀中繼frame-relay :
7.1幀中繼監測
8、啓動ftp服務:
9、配置 DHCP服務
10、配置地址池和地址列表
10.1 QuidWay系列交換機
10.2 3500/3026E/3026F/3050 交換機
10.3 S3600系列交換機
10.4 S6500/S7500 系列交換機
11、華爲交換機配置命令解釋
PCAlogin:root; 使用root用戶
password:linux; 口令是linux
shutdown -h now;、init0; 關機
logout; 用戶註銷
login; 用戶登陸
ifconfig; 顯示IP地址
ifconfig eth0 netmask; 設置IP地址
ifconfig eht0 netmask down; 禁用IP地址
route add 0.0.0.0 gw; 設置網關
route de l0.0.0.0 gw; 刪除網關
route add default gw; 設置網關
route del default gw; 刪除網關
route; 顯示網關
ping; 發ECHO包
telnet; 遠程登陸
[Quidway]dis cur; 顯示當前配置
[Quidway]display current-configuration; 顯示當前配置
[Quidway]display interfaces; 顯示接口信息
[Quidway]display vlanall; 顯示路由信息
[Quidway]display version; 顯示版本信息
[Quidway]super password; 修改特權用戶密碼
[Quidway]sysname; 交換機命名
[Quidway]interface ethernet0/1; 進入接口視圖
[Quidway]interface vlanx; 進入接口視圖
[Quidway]dis log 查看交換機日誌
[Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0; 配置VLAN的IP地址
[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.65.1.2;
靜態路由=網關
[Quidway]rip; 三層交換支持
[Quidway]local-user ftp 【沒有,找不到】
[Quidway]user-interface vty 0 4; 進入虛擬終端
[S3026-ui-vty0-4]authentication-mode password; 設置口令模式
[S3026-ui-vty0-4]set authentication-mode password simple222; 設置口令
[S3026-ui-vty0-4]user privilege level3; 用戶級別
[Quidway]interface ethernet0/1; 進入端口模式
[Quidway]int e0/1; 進入端口模式
[Quidway-Ethernet0/1]duplex{half|full|auto};配置端口工做狀態
[Quidway-Ethernet0/1]speed{10|100|auto}; 配置端口工做速率
[Quidway-Ethernet0/1]flow-control; 配置端口流控
[Quidway-Ethernet0/1]mdi{across|auto|normal};
配置端口平接扭接
[Quidway-Ethernet0/1]port link-type {trunk|access|hybrid};
設置端口工做模式
[Quidway-Ethernet0/1]port access vlan3; 當前端口加入到VLAN
[Quidway-Ethernet0/2]port trunk permit vlan{ID|All};
設trunk容許的VLAN
[Quidway-Ethernet0/3]port trunk pvid vlan3; 設置trunk端口的PVID
[Quidway-Ethernet0/1]undo shutdown; 激活端口
[Quidway-Ethernet0/1]shutdown; 關閉端口
[Quidway-Ethernet0/1]quit; 返回
[Quidway]vlan3; 建立VLAN
[Quidway-vlan3]port ethernet0/1; 在VLAN中增長端口
[Quidway-vlan3]port ethernet0/1 to ethernet0/4;在VLAN中增長端口
[Quidway-vlan3]port e0/1; 簡寫方式
[Quidway-vlan3]port e0/1 to e0/4; 簡寫方式
[Quidway]monitor-port; 指定鏡像端口
[Quidway]portmirror; 指定被鏡像端口
[Quidway]portmirrorint_listobserving-portint_typeint_num;
指定鏡像和被鏡像
[Quidway]description string; 指定VLAN描述字符
[Quidway]description; 刪除VLAN描述字符
[Quidway]displayvlan[vlan_id]; 查看VLAN設置
[Quidway]stp{enable|disable}; 設置生成樹,默認關閉
[Quidway]stp priority 4096; 設置交換機的優先級
[Quidway]stp root{primary|secondary}; 設置爲根或根的備份
[Quidway-Ethernet0/1]stp cost200; 設置交換機端口的花費
[Quidway]link-aggregatione0/1toe0/4ingress|both; 端口的聚合
[Quidway]undolink-aggregatione0/1|all; 始端口爲通道號
[SwitchA-vlanx]isolate-user-vlanenable; 設置主vlan
[SwitchA]isolate-user-vlansecondary; 設置主vlan包括的子vlan
[Quidway-Ethernet0/2]port hybrid pvid vlan; 設置vlan的pvid
[Quidway-Ethernet0/2]port hybrid pvid; 刪除vlan的pvid
[Quidway-Ethernet0/2]porthybridvlanvlan_id_listuntagged;
設置無標識的vlan,若是包的vlanid與PVId一致,則去掉vlan信息.默認PVID=1。因此設置PVID爲所屬vlanid,設置能夠互通的vlan爲untagged.
[Quidway]display version; 顯示版本信息
[Quidway]display current-configuration; 顯示當前配置
[Quidway]display interfaces; 顯示接口信息
[Quidway]display ip route; 顯示路由信息
[Quidway]sysname aabbcc; 更改主機名
[Quidway]super passwrod 123456; 設置口令
[Quidway]interface serial0; 進入接口
[Quidway-serial0]ip address; 配置端口IP地址
[Quidway-serial0]undo shutdown; 激活端口
[Quidway]link-protocol hdlc; 綁定hdlc協議
[Quidway]user-interface vty 0 4
[Quidway-ui-vty0-4]authentication-mode password
[Quidway-ui-vty0-4]setauthentication-mode password simple 222
[Quidway-ui-vty0-4]user privilege level3
[Quidway-ui-vty0-4]quit 【沒有】
[Quidway]debugging hdlc all serial0; 顯示全部信息
[Quidway]debugging hdlc event serial0; 調試事件信息
[Quidway]debugging hdlc packet serial0; 顯示包的信息
[Quidway]iproute-static{interfacenumber|nexthop}
[value][reject|blackhole] 例如:
[Quidway]iproute-static 129.1.0.0 16 10.0.0.2
[Quidway]iproute-static 129.1.0.0 255.255.0.0 10.0.0.2
[Quidway]iproute-static 129.1.0.0 16 Serial2
[Quidway]iproute-static 0.0.0.0 0.0.0.0 10.0.0.2
[Quidway]rip; 設置動態路由
[Quidway]ripwork; 設置工做容許
[Quidway]rip input; 設置入口容許
[Quidway]rip output; 設置出口容許
[Quidway-rip]network 1.0.0.0; 設置交換路由網絡
[Quidway-rip]network all; 設置與全部網絡交換
[Quidway-rip]peer ip-address; 【沒有】
[Quidway-rip]summary; 路由聚合
[Quidway]rip version1; 設置工做在版本1
[Quidway]rip version2 multicast; 設版本2,多播方式
[Quidway-Ethernet0]rip split-horizon; 水平分隔
[Quidway]routerid A.B.C.D; 配置路由器的ID
[Quidway]ospf enable; 啓動OSPF協議
[Quidway-ospf]import-route direct; 引入直聯路由
[Quidway-Serial0]ospf enable area; 配置OSPF區域
acl[match-orderconfig|auto]
默認前者順序匹配。
rule[normal|special]{permit|deny}[sourcesource-addrsource-wildcard|any]
例:
[Quidway]acl 10
[Quidway-acl-10]rule normal permit source 10.0.0.0 0.0.0.255
[Quidway-acl-10]rule normal deny source any
rule{normal|special}{permit|deny}{tcp|udp}source{|any}destination|any}
[operate]
rule{normal|special}{permit|deny}icmpsource{|any]destination{|any]
[icmp-code][logging]
[Quidway]acl 101
[Quidway-acl-101]rule deny souce any destination any
[Quidway-acl-101]rule permit icmp source any destinationany icmp-type echo
[Quidway-acl-101]rule permit icmp source any destination any icmp-type echo-reply
[Quidway]acl 102
[Quidway-acl-102]rule permit ip source 10.0.0.1 0.0.0.0 destination 202.0.0.1 0.0.0.0
[Quidway-acl-102]rule deny ip source any destination any
[Quidway]acl 103
[Quidway-acl-103]rule permit tcp source any destination 10.0.0.1 0.0.0.0 destination-port equal ftp
[Quidway-acl-103]rule permit tcp source any destination 10.0.0.2 0.0.0.0 destination-port equal www
[Quidway]firewall enable
[Quidway]firewall default permit|deny
[Quidway]inte0
[Quidway-Ethernet0]firewall packet-filter 101 inbound|outbound
[Quidway]firewall enable
[Quidway]firewall default permit
[Quidway]acl101;內部指定主機能夠進入e0
[Quidway-acl-101]rule deny ip source any destination any
[Quidway-acl-101]rule permit ip source 129.38.1.10 destination any
[Quidway-acl-101]rule permit ip source 129.38.1.20 destination any
[Quidway-acl-101]rule permit ip source 129.38.1.30 destination any
[Quidway-acl-101]rule permit ip source 129.38.1.40 destination any
[Quidway-acl-101]quit
[Quidway]int e0
[Quidway-Ethernet0]firewall packet-filter 101 inbound
[Quidway]acl102;外部特定主機和大於1024端口的數據包容許進入S0
[Quidway-acl-102]rule deny ip source any destination any
[Quidway-acl-102]rule permit tcp source 202.39.2.30 destination 202.38.160.10
[Quidway-acl-102]rule permit tcp source any destination 202.38.160.10 destination-portgreat-than 1024
[Quidway-acl-102]quit
[Quidway]int s0
[Quidway-Serial0]firewall packet-filter 102 inbou 設202.38.160.1是路由器出口IP。
[Quidway-Serial0]nat outbound 101 +interface;是Easyip,將acl101容許的IP從本接口出時變換源地址。
nat server global [port] inside port [protocol]
global_port不寫時使用inside_port
[Quidway-Serial0]nat server global 202.38.160.1 inside 129.38.1.1 ftp tcp
[Quidway-Serial0]nat server global 202.38.160.1 inside 129.38.1.2 telnet tcp
[Quidway-Serial0]nat server global 202.38.160.1 inside 129.38.1.3 www tcp
設有公網IP:202.38.160.101~202.38.160.103能夠使用。對外訪問
[Quidway]nat address-group 202.38.160.101 202.38.160.103 pool1;
創建地址池
[Quidway]acl1
[Quidway-acl-1]rule permit source 10.110.10.0 0.0.0.255;
指定容許的內部網絡
[Quidway-acl-1]rule deny source any
[Quidway-acl-1]int serial0
[Quidway-Serial0]nat out bound1 address-group pool1;
在s0口從地址池取出IP對外訪問
[Quidway-Serial0]nat server global 202.38.160.101 inside 10.110.10.1 ftp tcp
[Quidway-Serial0]nat server global 202.38.160.102 inside 10.110.10.2 www tcp
[Quidway-Serial0]nat server global 202.38.160.102 8080 inside 10.110.10.3 www tcp
[Quidway-Serial0]nat server global 202.38.160.103 inside 10.110.10.4 smtp udp
設置:[Quidway-s0]link-protocol ppp
默認的協議
驗證:主驗方:pap|chap
[Quidway]local-userq2 password {simple|cipher} hello;路由器1
[Quidway]interface serial0
[Quidway-serial0]ppp authentication-mode {pap|chap}
[Quidway-serial0]ppp chap userq1;pap時,沒有此句
pap被驗方:
[Quidway]interface serial0;路由器2
[Quidway-serial0]ppp pap local-userq2 password {simple|cipher} hello
chap被驗方:
[Quidway]interface serial0;路由器2
[Quidway-serial0]ppp chap userq2;本身路由器名
[Quidway-serial0]local-userq1 password {simple|cipher} hello;對方路由器名
[q1]fr switching
[q1]int s1
[q1-Serial1]ip address 192.168.34.51 255.255.255.0
[q1-Serial1]link-protocol fr;封裝幀中繼協議
[q1-Serial1]fr interface-type dce
[q1-Serial1]frdlci100
[q1-Serial1]frinarp
[q1-Serial1]frmap ip 192.168.34.52dlci100
[q2]int s1
[q2-Serial1]ip address 192.168.34.52 255.255.255.0
[q2-Serial1]link-protocol fr
[q2-Serial1]fr interface-type dte
[q2-Serial1]fr dlci100
[q2-Serial1]fr in arp
[q2-Serial1]frmap ip 192.168.34.51 dlci 100
[q1]display frlmi-info[]interfacetypenumber]
[q1]display frmap
[q1]display frpvc-info[serialinterface-number][dlcidlci-number]
[q1]display frdlci-switch
[q1]display frinterface
[q1]reset frinarp-info
[q1]debugging frall[interfacetypenumber]
[q1]debugging frarp[interfacetypenumber]
[q1]debugging frevent[interfacetypenumber]
[q1]debugging frlmi[interfacetypenumber]
[Quidway]local-user ftp password {simple|cipher} aaa service-type ftp
[Quidway]ftp server enable
# 使能 DHCP服務。
<HuaWei> system-view
[HuaWei] dhcp enable
# 配置不參與自動分配的 IP 地址(DNS服務器、WINS服務器和出口網關地址) 。
[HuaWei] dhcp server forbidden-ip 10.1.1.2
[HuaWei] dhcp server forbidden-ip 10.1.1.4
[HuaWei] dhcp server forbidden-ip 10.1.1.126
[HuaWei] dhcp server forbidden-ip 10.1.1.254
# 配置 DHCP地址池 1 的屬性(地址池範圍、出口網關、地址租用期限、 dns 服務器)。
[HuaWei] dhcp server ip-pool 1
[HuaWei-dhcp-pool-1] network 10.1.1.0 mask 255.255.255.128
[HuaWei-dhcp-pool-1] gateway-list 10.1.1.126
[HuaWei-dhcp-pool-1] domain-name vlan20
[HuaWei-dhcp-pool-1] dns-list 202.106.116.1 202.106.0.20
[HuaWei-dhcp-pool-1] expired day 8
[HuaWei-dhcp-pool-1] quit
[Router] nat address-group 202.38.160.101 202.38.160.103 pool1
[Router] acl 2000
[Router-acl-2000]rule permit source 10.110.10.0 0.0.0.255
# 容許 10.110.10.0/24 的網段進行地址轉換
[Router-Serial0] nat outbound 2000 address-group pool
# 設置內部 FTP 服務器
[Router-Serial0] nat server global 202.38.160.101 inside 10.110.10.1 ftp tcp
# 設置內部 WWW服務器 1
[Router-Serial0] nat server global 202.38.160.102 inside 10.110.10.2 www tcp
# 設置內部 WWW服務器 2
[Router-Serial0] nat server global 202.38.160.102 8080 inside 10.110.10.3 www tcp
# 設置內部 SMTP 服務器
[Router-Serial0] nat server global 202.38.160.103 inside 10.110.10.4 smtp udp
內部局域網經過地址轉換後撥號訪問 Internet
方法 1:
system-view
[HuaWei] monitor-port Ethernet 0/24
[HuaWei] port mirror Ethernet 0/1 to Ethernet 0/8
方法 2:
[HuaWei] port mirror Ethernet 0/1 to Ethernet 0/8 observing-port Ethernet
0/24
基於流鏡像的交換機針對某些流進行鏡像, 每一個鏈接都有兩個方向的數據流, 對於交換機來講這兩個數據流是要分開鏡像的。
[SwitchA]acl num 100
[SwitchA-acl-adv-101]rule 0 permit ip source 1.1.1.1 0 destination any
[SwitchA-acl-adv-101]rule 1 permit ip source any destination 1.1.1.1 0
[SwitchA]mirrored-to ip-group 100 interface e0/8
[SwitchA]acl num 200
[SwitchA]rule 0 permit ingress interface Ethernet0/1 egress interface Ethernet0/2
[SwitchA]rule 1 permit ingress interface Ethernet0/2 egress interface Ethernet0/1
[SwitchA]mirrored-to link-group 200 interface e0/8
system-view
[HuaWei] mirroring-group 1 local
[HuaWei] interface gigabitEthernet 1/1/4
[HuaWei-GigabitEthernet1/1/4] monitor-port
[HuaWei-GigabitEthernet1/1/4] quit
[HuaWei] interface gigabitEthernet 1/1/1
[HuaWei-GigabitEthernet1/1/1] mirroring-port both
system-view
[HuaWei] mirroring-group 1 local
[HuaWei] interface GigabitEthernet 1/1/4
[HuaWei-GigabitEthernet1/1/4] mirroring-group 1 monitor-port
[HuaWei-GigabitEthernet1/1/4] quit
[HuaWei] interface GigabitEthernet 1/1/1
[HuaWei-GigabitEthernet1/1/1] mirroring-group 1 mirroring-port both
system-view
[HuaWei] mirroring-group 1 local
[HuaWei] mirroring-group 1 monitor-port GigabitEthernet 1/1/4 [HuaWei] mirroring-group 1 mirroring-port GigabitEthernet 1/1/1 both
<SWITCH> system-view [SWITCH] mirroring-group 1 local
[SWITCH] interface GigabitEthernet 1/0/2
定義當前端口爲鏡像目的端口 [SWITCH-GigabitEthernet1/0/2] mirroring-group 1 monitor-port
進入鏡像源端口的以太網端口視圖
[SWITCH] interface GigabitEthernet 1/0/1
[SWITCH-GigabitEthernet1/0/1] mirroring-group 1 mirroring-port both
<SWITCH> system-view [SWITCH] mirroring-group 1 local
[SWITCH] mirroring-group 1 monitor-port GigabitEthernet 1/0/2
[SWITCH] mirroring-group 1 mirroring-port GigabitEthernet 1/0/1 both
<Quidway>用戶視圖,只能看配置
<Quidway>reset save (清除配置文件)
<Quidway>reboot (重啓華爲交換機)
<Quidway>system view (進入配置模式)
<Quidway>sys (省略式打法)
[]表示配置模式
修改交換機:
[Quidway]sysname sw1
[sw1]
配置VLAN:
[Quidway]vlan 2
[Quidway-vlan2]port ether 0/10 to e 0/12
[Quidway-vlan2]quit
等同於
[Quidway]int e0/13
[Quidway-Ethernet0/13]port access vlan 2
[Quidway-Ethernet0/13]quit
配置trunk端口:
[Quidway]int e0/1
[Quidway-Ethernet0/1]port link-type trunk
[Quidway-Ethernet0/1]int e0/2
[Quidway-Ethernet0/2]port link-type trunk
[Quidway-Ethernet0/2]quit
兩邊的端口都要配trunk,經過trunk 不打標籤!默認trunk 只容許vlan 1 經過
[Quidway]int e0/1
[Quidway-Ethernet0/1]port trunk permit vlan all
[Quidway-Ethernet0/1]int e0/2
[Quidway-Ethernet0/2]port trunk permit vlan all
兩邊端口都要配置充許trunk 全部VLAN,若是是指定經過 vlan號,將vlan all 改爲對應的vlan編號便可。
取消任何命令,是在命令前面加一個 undo 便可!
華爲的交換機生成樹功能默認是關掉的交換機造成環路,所聯接的端口會不停的閃爍!
[Quidway]stp enable(開)
[Quidway]stp disable(關)
要在兩臺交換機上配置
鏈路聚合能夠提升帶寬和負載均衡,配置鏈路聚合時,兩端的端口模式須要配置成同樣(雙工,半又工),速率也要指定,不能本身自協商狀態!
[Quidway]link-aggregation e0/1 to e0/2 both
如:
【華爲路由器交換機配置命令】的下載連接和密碼: 連接:https://wljslmz.lanzous.com/i9O1Djmfgah 密碼:2333 獲取更多題庫內容或hcia/hcip/hcie相關學習資料可 + Q 裙 :696283186