天天看點

華為AR路由器端口配置trunk_銳捷交換機和路由器的一些基礎指令

一直在想要不要把銳捷的指令整理出來,其實銳捷的指令和思科的基礎指令是一樣的,隻要熟悉 思科指令,那麼銳捷的指令基本上是沒有問題的。但是有好多的粉絲私信我想要一份,我就稍微整理一下一些的基礎指令。

整理出來的指令可以看一看,因為每年網絡裝置産品一直在更新,是以可能指令也會更新,可能會有些指令是不同的。我這邊整理的可能不是最新的指令。有什麼好的建議大家在評論區提一提!

華為AR路由器端口配置trunk_銳捷交換機和路由器的一些基礎指令

一、基礎配置指令

1、準備指令

write memory 儲存配置檔案

del flash:config.text //删除配置檔案(交換機及1700系列路由器)

erase startup-config //删除配置檔案(2500系列路由器)

del flash:vlan.dat //删除Vlan配置資訊(交換機)

Configure terminal //進入全局配置模式

banner motd & // 配置每日提示資訊 &為終止符

enable secret level 1 0 123456 //配置遠端登陸密碼為123456

enable services web-server //開啟WEB管理功能

2、檢視資訊

show running-config //檢視目前配置資訊

show interface fastethernet 0/3 //檢視F0/3端口資訊

show ip interface brief //以彙總檢視所有端口資訊

show mac-address-table //檢視交換機MAC位址表資訊

show vlan //檢視所有VLAN資訊

show aggregateport 1 summary //檢視聚合端口AG1的資訊

show spanning-tree //檢視生成樹配置資訊

show port-security //檢視交換機的端口安全配置資訊

show port-security address //檢視位址安全綁定配置資訊

show ip access-lists listname //檢視名為listname的清單的配置資訊

3、端口的基本配置

interface range fa 0/1-2 //進入F0/1、F0/2的端口配置模式

speed 100 //配置端口速率為100M

duplex full //配置端口為全雙工模式

switchport access vlan 10 //将該端口劃入VLAN10中,用于VLAN

switchport mode trunk //将該端口設為trunk模式

port-group 1 //将該端口劃入聚合端口AG1中,用于聚合端口

interface aggregateport 1 //建立聚合接口AG1

5、生成樹

spanning-tree mst configuration //建立多生成樹協定

name ruijie //命名為ruijie

revision 1 //設定校訂本為1

instance 0 vlan 10,20 //建立執行個體0

spanning-tree mst 0 priority 4096 //設定優先級為4096

interface vlan 10

vrrp 1 ip 192.168.10.1 //此為vlan 10的IP位址

interface vlan 10 //進入VLAN 10的虛拟端口配置模式

ip address 192.168.1.1 255.255.255.0 //為VLAN10的虛拟端口配置IP及掩碼。

no shutdown //啟用該端口

7、端口安全

switchport port-security //開啟該端口的安全功能

a、配置最大連接配接數限制

switchport port-secruity maxmum 1 //配置端口的最大連接配接數為1,最大連接配接數為128

switchport port-secruity violation shutdown

//配置安全違例的處理方式為shutdown,可選為protect (當安全位址數滿後,将未知名位址丢棄)

b、IP和MAC位址綁定

switchport port-security mac-address xxxx.xxxx.xxxx ip-address 172.16.1.1

//接口配置模式下配置MAC位址xxxx.xxxx.xxxx和IP172.16.1.1進行綁定(MAC位址注意用小寫)

8、三層路由功能(針對三層交換機)

ip routing //開啟三層交換機的路由功能

interface fastethernet 0/1

no switchport //開啟端口的三層路由功能

ip address 192.168.1.1 255.255.255.0 //配置IP位址

9、三層交換機路由協定

ip route 172.16.1.0 255.255.255.0 172.16.2.1 //配置靜态路由

router rip //開啟RIP協定程序

network 172.16.1.0 //申明本裝置的直連網段資訊

version 2 //開啟RIP V2

no auto-summary //關閉路由資訊的自動彙總功能(隻有在RIPV2支援)

router ospf //開啟OSPF路由協定程序

router ospf 100 //開啟OSPF路由協定程序

network 192.168.1.0 0.0.0.255 area 0

//申明直連網段資訊,并配置設定區域号(area0為骨幹區域)

10、IP ACL:

ip access-list stand listname //定義命名标準清單,命名為listname,stand為标準清單

deny 192.168.30.0 0.0.0.255 //拒絕來自192.168.30.0網段的IP流量通過

192.168.30.0 0.0.0.255:源位址及源位址通配符;可使用any表示任何IP

permit any

b、擴充ACL

ip access-list extended listname //定義命名擴充清單,命名為listname

deny tcp 192.168.30.0 0.0.0.255 192.168.10.0 0.0.0.255 eq www //拒絕源位址為192.168.30.0網段的IP通路目的位址為192.168.10.0網段的WWW服務

permit ip any any //允許其它通過

interface vlan 10 //進入端口配置模式

ip access-group listname in //通路控制清單在端口下in方向應用

其他配置指令:

遠端登入密碼

(config)#line vty 0 4

(config-line)#password 123456

修改交換機老化時間

(config)#mac-address-table aging-time 20

添删vlan

(config)#vlan 888

(config-vlan)#name a888

(config)#no vlan 888

切換assess trunk

(config-if)#switchport mode access

(config-if)#switchport mode trunk

指定特定一個native vlan

(config-if)#switchport trunk native vlan 10

配置網關:

switch(config)#ip default-gateway 192.168.1.254

顯示接口詳細資訊的指令

show interfaces gigabitEthernet 4/1 counters

接口配置

Switch(config)#interface gigabitethernet 0/1

把接口工作模式改為光口。

Switch(config-if)#medium-type fiber

把接口工作模式改為電口。

Switch(config-if)#medium-type copper