導航:首頁 > 程序命令 > 創建vtp域的命令

創建vtp域的命令

發布時間:2022-12-12 19:55:23

① 思科三層交換機配置實例及命令

三層交換機是不是經常讓你機器不好使,看看下面的三層交換機配置文章,一切問題都能解決。本文詳細介紹實例講解:全面的三層交換機配置比較全面的三層交換機配置實例,帶命令解釋喲!

三層交換機配置:

Enable //進入私有模式

Configure terminal //進入全局模式

service password-encryption //對密碼進行加密

hostname Catalyst 3550-12T1 //給三層交換機定義名稱

enable password 123456. //enable密碼

Enable secret 654321 //enable的加密密碼(應該是亂碼而不是654321這樣)

Ip subnet-zero //允許使用全0子網(默認都是打開的)

Ip name-server 172.16.8.1 172.16.8.2 //三層交換機名字Catalyst 3550-12T1對應的IP地址是172.16.8.1

Service dhcp //提供DHCP服務

ip routing //啟用三層交換機上的路由模塊

Exit

三層交換機配置:

Vtp mode server //定義VTP工作模式為sever模式

Vtp domain centervtp //定義VTP域的名稱為centervtp

Vlan 2 name vlan2 //定義vlan並給vlan取名(如果不取名的話,vlan2的名字應該是vlan002)

Vlan 3 name vlan3

Vlan 4 name vlan4

Vlan 5 name vlan5

Vlan 6 name vlan6

Vlan 7 name vlan7

Vlan 8 name vlan8

Vlan 9 name vlan9

Exit

三層交換機配置:

interface Port-channel 1 //進入虛擬的以太通道組1

switchport trunk encapsulation dot1q //給這個介面的trunk封裝為802.1Q的幀格式

switchport mode trunk //定義這個介面的工作模式為trunk

switchport trunk allowed vlan all //在這個trunk上允許所有的vlan通過

Interface gigabitethernet 0/1 //進入模塊0上的吉比特以太口1

switchport trunk encapsulation dotlq //給這個介面的trunk封裝為802.1Q的幀格式

switchport mode trunk //定義這個介面的工作模式為trunk

switchport trunk allowed vlan all //在這個trunk上允許所有的vlan通過

channel-group 1 mode on //把這個介面放到快速以太通道組1中

Interface gigabitethernet 0/2 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

channel-group 1 mode on

三層交換機配置:

port-channel load-balance src-dst-ip //定義快速以太通道組的負載均衡方式(依*源和目的IP的方式)

interface gigabitethernet 0/3 //進入模塊0上的吉比特以太口3

switchport trunk encapsulation dotlq //給trunk封裝為802.1Q

switchport mode trunk //定義這個介面的工作模式為trunk

switchport trunk allowed vlan all //允許所有vlan信息通過

interface gigabitethernet 0/4 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

interface gigbitethernet 0/5 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

interface gigbitethernet 0/6 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchprot trunk allowed vlan all

三層交換機配置:

interface gigbitethernet 0/7 //進入模塊0上的吉比特以太口7

Switchport mode access //定義這個介面的工作模式為訪問模式

switchport access vlan 9 //定義這個介面可以訪問哪個vlan(實際就是分配這個介面到vlan)

no shutdown

spanning-tree vlan 6-9 cost 1000 //在生成樹中,vlan6-9的開銷定義為10000

interface range gigabitethernet 0/8 – 10 //進入模塊0上的吉比特以太口8,9,10

switchport mode access //定義這些介面的'工作模式為訪問模式

switchport access vlan 8 //把這些介面都分配到vlan8中

no shutdown

三層交換機配置:

spanning-tree portfast //在這些介面上使用portfast(使用portfast以後,在生成樹的時候不參加運算,直接成為轉發狀態)

interface gigabitethernet 0/11 //進入模塊0上的吉比特以太口11

switchport trunk encapsulation dotlq //給這個介面封裝為802.1Q

switchport mode trunk //定義這個介面的工作模式為trunk

switchport trunk allowed vlan all //允許所有vlan信息通過

interface gigabitethernet 0/12 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

interface vlan 1 //進入vlan1的邏輯介面(不是物理介面,用來給vlan做路由用)

ip address 172.16.1.7 255.255.255.0 //配置IP地址和子網掩碼

no shutdown

三層交換機配置:

standby 1 ip 172.16.1.9 //開啟了冗餘熱備份(HSRP),冗餘熱備份組1,虛擬路由器的IP地址為172.16.1.9

standby 1 priority 110 preempt //定義這個三層交換機在冗餘熱備份組1中的優先順序為110,preempt是用來開啟搶占模式

interface vlan 2 //同上

ip address 172.16.2.252 255.255.255.0

no shutdown

standby 2 ip 172.16.2.254

standby 2 priority 110 preempt

ip access-group 101 in //在入方向上使用擴展的訪問控制列表101

interface vlan 3 //同上

ip address 172.16.3.252 255.255.255.0

no shutdown

三層交換機配置:

standby 3 ip 172.16.3.254

standby 3 priority 110 preempt

ip access-group 101 in

interface vlan 4 //同上

ip address 172.16.4.252 255.255.255.0

no shutdown

standby 4 ip 172.16.4.254

standby 4 priority 110 preempt

ip access-group 101 in

interface vlan 5

ip address 172.16.5.252 255.255.255.0

no shutdown

standby 5 ip 172.16.5.254

standby 5 priority 110 preempt

ip access-group 101 in

interface vlan 6

ip address 172.16.6.252 255.255.255.0

no shutdown

三層交換機配置:

standby 6 ip 172.16.6.254

standby 6 priority 100 preempt

interface vlan 7

ip address 172.16.7.252 255.255.255.0

no shutdown

standby 7 ip 172.16.7.254

standby 7 priority 100 preempt

interface vlan 8

ip address 172.16.8.252 255.255.255.0

no shutdown

standby 8 ip 172.16.8.254

standby 8 priority 100 preempt

interface vlan 9

ip address 172.16.9.252 255.255.255.0

no shutdown

三層交換機配置:

standby 9 ip 172.16.9.254

standby 9 priority 100 preempt

access-list 101 deny ip any 172.16.7.0 0.0.0.255 //擴展的訪問控制列表101

access-list 101 permit ip any any

Interface vlan 1 //進入vlan1這個邏輯介面

Ip helper-address 172.16.8.1 //可以轉發廣播(helper-address的作用就是把廣播轉化為單播,然後發向172.16.8.1)

Interface vlan 2

Ip helper-address 172.16.8.1

Interface vlan 3

ip helper-address 172.16.8.1

interface vlan 4

ip helper-address 172.16.8.1

interface vlan 5

ip helper-address 172.16.8.1

interface vlan 6

ip helper-address 172.16.8.1

interface vlan 7

ip helper-address 172.16.8.1

interface vlan 9

ip helper-address 172.16.8.1

router rip//啟用路由協議RIP

version 2//使用的是RIPv2,如果沒有這句,則是使用RIPv1

network 172.16.0.0//宣告直連的網段

exit

三層交換機配置:

ip route 0.0.0.0 0.0.0.0 172.16.9.250//預設路由,所有在路由表中沒有辦法匹配的數據包,都發向下一跳地址為172.16.9.250這個路由器

line con 0

line aux 0

line vty 0 15//telnet線路(路由器只有5個,是0-4)

password 12345678//login密碼

login

end

running-config startup-config 保存配置

② 三層交換機配置及命令解釋

三層交換機配置及命令解釋

你對詳細的命令熟悉了嗎?本文詳細介紹實例講解:全面的三層交換機配置比較全面的三層交換機配置實例,帶命令解釋!

三層交換機配置:

Enable //進入私有模式

Configure terminal //進入全局模式

service password-encryption //對密碼進行加密

hostname Catalyst 3550-12T1 //給三層交換機定義名稱

enable password 123456. //enable密碼

Enable secret 654321 //enable的加密密碼(應該是亂碼而不是654321這樣)

Ip subnet-zero //允許使用全0子網(默認都是打開的)

Ip name-server 172.16.8.1 172.16.8.2 //三層交換機名字Catalyst 3550-12T1對應的IP地址是172.16.8.1

Service dhcp //提供DHCP服務

ip routing //啟用三層交換機上的路由模塊

Exit

三層交換機配置:

Vtp mode server //定義VTP工作模式為sever模式

Vtp domain centervtp //定義VTP域的名稱為centervtp

Vlan 2 name vlan2 //定義vlan並給vlan取名(如果不取名的話,vlan2的名字應該是vlan002)

Vlan 3 name vlan3

Vlan 4 name vlan4

Vlan 5 name vlan5

Vlan 6 name vlan6

Vlan 7 name vlan7

Vlan 8 name vlan8

Vlan 9 name vlan9

Exit

三層交換機配置:

interface Port-channel 1 //進入虛擬的以太通道組1

switchport trunk encapsulation dot1q //給這個介面的trunk封裝為802.1Q的幀格式

switchport mode trunk //定義這個介面的工作模式為trunk

switchport trunk allowed vlan all //在這個trunk上允許所有的vlan通過

Interface gigabitethernet 0/1 //進入模塊0上的吉比特以太口1

switchport trunk encapsulation dotlq //給這個介面的trunk封裝為802.1Q的幀格式

switchport mode trunk //定義這個介面的工作模式為trunk

switchport trunk allowed vlan all //在這個trunk上允許所有的vlan通過

channel-group 1 mode on //把這個介面放到快速以太通道組1中

Interface gigabitethernet 0/2 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

channel-group 1 mode on

三層交換機配置:

port-channel load-balance src-dst-ip //定義快速以太通道組的負載均衡方式(依*源和目的IP的方式)

interface gigabitethernet 0/3 //進入模塊0上的吉比特以太口3

switchport trunk encapsulation dotlq //給trunk封裝為802.1Q

switchport mode trunk //定義這個介面的.工作模式為trunk

switchport trunk allowed vlan all //允許所有vlan信息通過

interface gigabitethernet 0/4 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

interface gigbitethernet 0/5 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

interface gigbitethernet 0/6 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchprot trunk allowed vlan all

三層交換機配置:

interface gigbitethernet 0/7 //進入模塊0上的吉比特以太口7

Switchport mode access //定義這個介面的工作模式為訪問模式

switchport access vlan 9 //定義這個介面可以訪問哪個vlan(實際就是分配這個介面到vlan)

no shutdown

spanning-tree vlan 6-9 cost 1000 //在生成樹中,vlan6-9的開銷定義為10000

interface range gigabitethernet 0/8 – 10 //進入模塊0上的吉比特以太口8,9,10

switchport mode access //定義這些介面的工作模式為訪問模式

switchport access vlan 8 //把這些介面都分配到vlan8中

no shutdown

三層交換機配置:

spanning-tree portfast //在這些介面上使用portfast(使用portfast以後,在生成樹的時候不參加運算,直接成為轉發狀態)

interface gigabitethernet 0/11 //進入模塊0上的吉比特以太口11

switchport trunk encapsulation dotlq //給這個介面封裝為802.1Q

switchport mode trunk //定義這個介面的工作模式為trunk

switchport trunk allowed vlan all //允許所有vlan信息通過

interface gigabitethernet 0/12 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

interface vlan 1 //進入vlan1的邏輯介面(不是物理介面,用來給vlan做路由用)

ip address 172.16.1.7 255.255.255.0 //配置IP地址和子網掩碼

no shutdown

三層交換機配置:

standby 1 ip 172.16.1.9 //開啟了冗餘熱備份(HSRP),冗餘熱備份組1,虛擬路由器的IP地址為172.16.1.9

standby 1 priority 110 preempt //定義這個三層交換機在冗餘熱備份組1中的優先順序為110,preempt是用來開啟搶占模式

interface vlan 2 //同上

ip address 172.16.2.252 255.255.255.0

no shutdown

standby 2 ip 172.16.2.254

standby 2 priority 110 preempt

ip access-group 101 in //在入方向上使用擴展的訪問控制列表101

interface vlan 3 //同上

ip address 172.16.3.252 255.255.255.0

no shutdown

三層交換機配置:

standby 3 ip 172.16.3.254

standby 3 priority 110 preempt

ip access-group 101 in

interface vlan 4 //同上

ip address 172.16.4.252 255.255.255.0

no shutdown

standby 4 ip 172.16.4.254

standby 4 priority 110 preempt

ip access-group 101 in

interface vlan 5

ip address 172.16.5.252 255.255.255.0

no shutdown

standby 5 ip 172.16.5.254

standby 5 priority 110 preempt

ip access-group 101 in

interface vlan 6

ip address 172.16.6.252 255.255.255.0

no shutdown

三層交換機配置:

standby 6 ip 172.16.6.254

standby 6 priority 100 preempt

interface vlan 7

ip address 172.16.7.252 255.255.255.0

no shutdown

standby 7 ip 172.16.7.254

standby 7 priority 100 preempt

interface vlan 8

ip address 172.16.8.252 255.255.255.0

no shutdown

standby 8 ip 172.16.8.254

standby 8 priority 100 preempt

interface vlan 9

ip address 172.16.9.252 255.255.255.0

no shutdown

三層交換機配置:

standby 9 ip 172.16.9.254

standby 9 priority 100 preempt

access-list 101 deny ip any 172.16.7.0 0.0.0.255 //擴展的訪問控制列表101

access-list 101 permit ip any any

Interface vlan 1 //進入vlan1這個邏輯介面

Ip helper-address 172.16.8.1 //可以轉發廣播(helper-address的作用就是把廣播轉化為單播,然後發向172.16.8.1)

Interface vlan 2

Ip helper-address 172.16.8.1

Interface vlan 3

ip helper-address 172.16.8.1

interface vlan 4

ip helper-address 172.16.8.1

interface vlan 5

ip helper-address 172.16.8.1

interface vlan 6

ip helper-address 172.16.8.1

interface vlan 7

ip helper-address 172.16.8.1

interface vlan 9

ip helper-address 172.16.8.1

router rip //啟用路由協議RIP

version 2 //使用的是RIPv2,如果沒有這句,則是使用RIPv1

network 172.16.0.0 //宣告直連的網段

exit

三層交換機配置:

ip route 0.0.0.0 0.0.0.0 172.16.9.250 //預設路由,所有在路由表中沒有辦法匹配的數據包,都發向下一跳地址為172.16.9.250這個路由器

line con 0

line aux 0

line vty 0 15 //telnet線路(路由器只有5個,是0-4)

password 12345678 //login密碼

login

end

running-config startup-config 保存配置

;

③ 如何建立VTP

VTP(VLAN Trunking Protocol)
VTP通過網路(ISL幀或cisco私有DTP幀)保持VLAN配置統一性。VTP在系統級管理增加,刪除,調整的VLAN,自動地將信息向網路中其它的交換機廣播。此外,VTP減小了那些可能導致安全問題的配置。便於管理,只要在vtp server做相應設置,vtp client會自動學習vtp server上的vlan信息
* 當使用多重名字VLAN能變成交叉--連接。
* 當它們是錯誤地映射在一個和其它區域網,VLAN能變成內部斷開。
VTP模式
當交換機是在VTP Server或透明的模式,能在交換機配置VLAN。當交換機配置在VTP Server或透明的模式,使用CLI、控制台菜單、MIB(當使用SNMP簡單網路管理協議管理工作站)修改VLAN配置。
一個配置為VTP Server模式的交換機向鄰近的交換機廣播VLAN配置,通過它的Trunk從鄰近的交換機學習新的VLAN配置。在Server模式下可以通過MIB,CLI,或者控制台模式添加、刪除和修改VLAN。
例如:增加了一個VLAN,VTP將廣播這個新的VLAN,Server和Client機的Trunk網路埠准備接收信息。
在交換機自動轉到VTP的Client模式後,它會傳送廣播信息並從廣播中學習新的信息。但是,不能通過MIB、CLI、或者控制台來增加、刪除、修改VLAN。VTP Client端不能保持VLAN信息在非易失存儲器中。當啟動時,它會通過Trunk網路埠接受廣播信息,學習配置信息。
在VTP透明的模式,交換不做廣播或從網路學習VLAN配置。當一個交換機是在VTP透明的模式,能通過控制台、CLI、MIB來修改、增加、刪除VLAN。
為使每一個VLAN能夠使用,必須使VTP知道。並且包含在Trunk port 的准許列表中,一個快速乙太網ISL Trunk自動為VLAN傳輸數據,並且從一個交換機到另一個交換機。
需要注意的是如果交換在VTP Server模式接收廣播包含128多個VLAN,交換自動地轉換向VTP Client模式。
更改交換機從VTP Client模式向VTP透明的模式,交換機保持初始、唯一128VLAN並刪除剩餘的VLAN。
傳送VTP信息
每個交換機用VTP廣播Trunk埠的管理域,定義特定的VLAN邊界,它的配置修訂號,已知VLAN和特定參數。在一個VTP管理域登記後交換機才能工作。
通過Trunk,VTP Server向其它交換機傳輸信息和接收更新。VTP Server也在NVRAM中保存本VTP管理域信息中 VLAN的列表。 VTP能通過統一的名字和內部的列表動態顯示出管理域中的VLAN。
VTP信息在全部Trunk連接上傳輸,包括ISL、IEEE802.10、LANE。VTP MIB為VTP提供SNMP工具,並允許瀏覽VTP參數配置。
VTP建立共用的配置值和分布下列的共用的配置信息:
* VLAN IDs(ISL)
* 仿效LAN的名字(ATM LANE)
* IEEE802.10 SAID值(FDDI)
* VLAN中最大的傳輸單元(MTU)大小
* 幀格式
VTP協議用來確保配置的一致性,VTP的具體優點如下:
。保持了VLAN的一致性
。提供從一個交換機到另一個交換機在整個管理域中增加虛擬區域網的方法
VTP協議是思科的專用協議,大多數的Catalys交換機都支持該協議,VTP可以減少VLAN的相關管理任務。
在VTP域中有兩個重要的概念:
。VTP域:也稱VLAN管理域,由一個以上共享VTP域名的相互連接的交換機組成的。也就是說VTP域是一組域名相同並通過中繼鏈路相互連接的交換機
。VTP通告:在交換機之間用來傳遞VLAN信息的數據包被成為VTP數據包

④ 華為三層交換機配置命令

華為三層交換機配置命令

你的三層交換機是不是經常讓你機器不好使,看看下面的三層交換機配置文章,一切問題都能解決。詳細介紹實例講解:全面的三層交換機配置比較全面的三層交換機配置實例,帶命令解釋喲!快來get吧!

三層交換機配置:

Enable //進入私有模式

Configure terminal //進入全局模式

service password-encryption //對密碼進行加密

hostname Catalyst 3550-12T1 //給三層交換機定義名稱

enable password 123456. //enable密碼

Enable secret 654321 //enable的加密密碼(應該是亂碼而不是654321這樣)

Ip subnet-zero //允許使用全0子網(默認都是打開的)

Ip name-server 172.16.8.1 172.16.8.2 //三層交換機名字Catalyst 3550-12T1對應的IP地址是172.16.8.1

Service dhcp //提供DHCP服務

ip routing //啟用三層交換機上的路由模塊

Exit

三層交換機配置:

Vtp mode server //定義VTP工作模式為sever模式

Vtp domain centervtp //定義VTP域的名稱為centervtp

Vlan 2 name vlan2 //定義vlan並給vlan取名(如果不取名的話,vlan2的名字應該是vlan002)

Vlan 3 name vlan3

Vlan 4 name vlan4

Vlan 5 name vlan5

Vlan 6 name vlan6

Vlan 7 name vlan7

Vlan 8 name vlan8

Vlan 9 name vlan9

Exit

三層交換機配置:

interface Port-channel 1 //進入虛擬的以太通道組1

switchport trunk encapsulation dot1q //給這個介面的trunk封裝為802.1Q的幀格式

switchport mode trunk //定義這個介面的工作模式為trunk

switchport trunk allowed vlan all //在這個trunk上允許所有的vlan通過

Interface gigabitethernet 0/1 //進入模塊0上的吉比特以太口1

switchport trunk encapsulation dotlq //給這個介面的trunk封裝為802.1Q的幀格式

switchport mode trunk //定義這個介面的工作模式為trunk

switchport trunk allowed vlan all //在這個trunk上允許所有的vlan通過

channel-group 1 mode on //把這個介面放到快速以太通道組1中

Interface gigabitethernet 0/2 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

channel-group 1 mode on

三層交換機配置:

port-channel load-balance src-dst-ip //定義快速以太通道組的負載均衡方式(依*源和目的IP的`方式)

interface gigabitethernet 0/3 //進入模塊0上的吉比特以太口3

switchport trunk encapsulation dotlq //給trunk封裝為802.1Q

switchport mode trunk //定義這個介面的工作模式為trunk

switchport trunk allowed vlan all //允許所有vlan信息通過

interface gigabitethernet 0/4 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

interface gigbitethernet 0/5 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

interface gigbitethernet 0/6 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchprot trunk allowed vlan all

三層交換機配置:

interface gigbitethernet 0/7 //進入模塊0上的吉比特以太口7

Switchport mode access //定義這個介面的工作模式為訪問模式

switchport access vlan 9 //定義這個介面可以訪問哪個vlan(實際就是分配這個介面到vlan)

no shutdown

spanning-tree vlan 6-9 cost 1000 //在生成樹中,vlan6-9的開銷定義為10000

interface range gigabitethernet 0/8 – 10 //進入模塊0上的吉比特以太口8,9,10

switchport mode access //定義這些介面的工作模式為訪問模式

switchport access vlan 8 //把這些介面都分配到vlan8中

no shutdown

三層交換機配置:

spanning-tree portfast //在這些介面上使用portfast(使用portfast以後,在生成樹的時候不參加運算,直接成為轉發狀態)

interface gigabitethernet 0/11 //進入模塊0上的吉比特以太口11

switchport trunk encapsulation dotlq //給這個介面封裝為802.1Q

switchport mode trunk //定義這個介面的工作模式為trunk

switchport trunk allowed vlan all //允許所有vlan信息通過

interface gigabitethernet 0/12 //同上

switchport trunk encapsulation dotlq

switchport mode trunk

switchport trunk allowed vlan all

interface vlan 1 //進入vlan1的邏輯介面(不是物理介面,用來給vlan做路由用)

ip address 172.16.1.7 255.255.255.0 //配置IP地址和子網掩碼

no shutdown

三層交換機配置:

standby 1 ip 172.16.1.9 //開啟了冗餘熱備份(HSRP),冗餘熱備份組1,虛擬路由器的IP地址為172.16.1.9

standby 1 priority 110 preempt //定義這個三層交換機在冗餘熱備份組1中的優先順序為110,preempt是用來開啟搶占模式

interface vlan 2 //同上

ip address 172.16.2.252 255.255.255.0

no shutdown

standby 2 ip 172.16.2.254

standby 2 priority 110 preempt

ip access-group 101 in //在入方向上使用擴展的訪問控制列表101

interface vlan 3 //同上

ip address 172.16.3.252 255.255.255.0

no shutdown

三層交換機配置:

standby 3 ip 172.16.3.254

standby 3 priority 110 preempt

ip access-group 101 in

interface vlan 4 //同上

ip address 172.16.4.252 255.255.255.0

no shutdown

standby 4 ip 172.16.4.254

standby 4 priority 110 preempt

ip access-group 101 in

interface vlan 5

ip address 172.16.5.252 255.255.255.0

no shutdown

standby 5 ip 172.16.5.254

standby 5 priority 110 preempt

ip access-group 101 in

interface vlan 6

ip address 172.16.6.252 255.255.255.0

no shutdown

三層交換機配置:

standby 6 ip 172.16.6.254

standby 6 priority 100 preempt

interface vlan 7

ip address 172.16.7.252 255.255.255.0

no shutdown

standby 7 ip 172.16.7.254

standby 7 priority 100 preempt

interface vlan 8

ip address 172.16.8.252 255.255.255.0

no shutdown

standby 8 ip 172.16.8.254

standby 8 priority 100 preempt

interface vlan 9

ip address 172.16.9.252 255.255.255.0

no shutdown

三層交換機配置:

standby 9 ip 172.16.9.254

standby 9 priority 100 preempt

access-list 101 deny ip any 172.16.7.0 0.0.0.255 //擴展的訪問控制列表101

access-list 101 permit ip any any

Interface vlan 1 //進入vlan1這個邏輯介面

Ip helper-address 172.16.8.1 //可以轉發廣播(helper-address的作用就是把廣播轉化為單播,然後發向172.16.8.1)

Interface vlan 2

Ip helper-address 172.16.8.1

Interface vlan 3

ip helper-address 172.16.8.1

interface vlan 4

ip helper-address 172.16.8.1

interface vlan 5

ip helper-address 172.16.8.1

interface vlan 6

ip helper-address 172.16.8.1

interface vlan 7

ip helper-address 172.16.8.1

interface vlan 9

ip helper-address 172.16.8.1

router rip //啟用路由協議RIP

version 2 //使用的是RIPv2,如果沒有這句,則是使用RIPv1

network 172.16.0.0 //宣告直連的網段

exit

三層交換機配置:

ip route 0.0.0.0 0.0.0.0 172.16.9.250 //預設路由,所有在路由表中沒有辦法匹配的數據包,都發向下一跳地址為172.16.9.250這個路由器

line con 0

line aux 0

line vty 0 15 //telnet線路(路由器只有5個,是0-4)

password 12345678 //login密碼

login

end

running-config startup-config 保存配置

;

⑤ 1.如何創建vtp管理域 2.劃分vlan管理IP地址 3.配置Trunk,封裝協議

vtp分為伺服器與客戶端,還有種角色叫透明代理。創建時所有交換機的VTP
的域名一定要相同。在一般企業中,很少有人使用。
VLAN管理地址,就是給VLAN配個IP地址,在三層交換機中,每個VLAN的地址都是接入終端設備的網關地址。二層中VLAN管理地址就是VLAN
1的地址,只能管理使用。
TRUNK的配置就是把交換機埠改為TRUNK模式,sw
mo
tr
命令即可,默認協議為DOT1Q,無需配置。注意,在兩台交換機連接中其中一個是trunk介面那麼另一個一定也要配成trunk介面。

⑥ 有VTP配置的簡單命令嗎

創建VTP 域
switch(config)# vtp domian domain_name

配置交換機的VTP模式
switch(config)# vtp mode server | client | transparent

配置VTP口令
switch(config)# vtp password password

配置VTP修剪
switch(config)# vtp pruning

VTP版本的配置
switch(config)# vtp version 2

查看VTP的配置
switch# show vtp status

⑦ 思科VTP(vlan truck 協議)創建

一、打開思科模擬器,先連接三台交換機(switch2、switch3、switch4)。

二、先配置伺服器(switch2)

        1、Switch(config)#host server

        2、Switch(config)#interface range f0/1-2

        3、Switch(config-if-range)#switchport mode truck

三、配置客服端(switch3)

         1、Switch(config)#host client

         2、Switch(config)#interface  f0/1

         3、Switch(config-if-range)#switchport mode truck

四、配置透明(switch4)

         1、Switch(config)#host transparent

         2、Switch(config)#interface  f0/1

         3、Switch(config-if-range)#switchport mode truck

五、查詢vtp狀態

        show vtp status

六、分別進入兩台交換機(switch3、switch4),配置客戶端和透明

        a、進入switch3

                1、Switch(config)#host client

                2、client(config)vtp mode client

       b、進入switch4

                1、Switch(config)#host client

                2、client(config)vtp mode transparent

七、分配域名

            a、在switch2下分配域名

            server(config)#vtp domain ccna

備註:1、vlan同步是互傳的,基於版本號,誰版本號大,就聽誰的 

            2、透明模式只透傳信息,它本身不發送,也不改變

            3、vtp平均五分鍾發送一次更新

            4、若伺服器修改,立刻觸發更新

            5、client端不能設置,不能修改

⑧ cisco交換機的vlan怎麼設置

交換機管理主要通過命令行完成。交換機的命令行操作模式,主要包括:用戶模式、特權模式、全局配置模式、埠模式等幾種。下面是我給大家帶來的cisco交換機的vlan設置方法,希望對您有所幫助!

步驟:

1.首先,安裝cisco packet tracer軟體,當前的版本應該是到了6點幾了,我這邊用的是6.0版本的,安裝完成之後打開該軟體,進入軟體配置主界面!

2.接著,我們以cisco交換機3560為例講述如何創建交換機的vlan。那麼下一步就是添加cisco交換機3560了:逐步點擊「交換機」分類,然後選擇cisco3560交換機,用滑鼠拖到工作區間就可以了。

3.然後,單擊Cisco交換機3560進入「CLI」界面,輸入「enable」命令進入特權配置模式。並輸入「vlan database」命令進入vlan配置模式。

4.接著,進入vlan的配置模式後,輸入命令「?」,可以查看當前模式下有哪些命令是可以使用的:

exit:退出vlan模式;

no:刪除某項vlan配置;

vlan:vlan模式下更深入的配置;

vtp:vlan下面vtp域的配置;

5.然後,我們開始為cisco交換機添加一個vlan 300,那麼直接運行命令」vlan 300「即可。

6.接著,我們執行」exit「命令退出vlan配置模式,執行命令」show vlan「在特權模式下查看cisco交換機的所有vlan信息。可以發現交換機已經添加了我們需要的vlan 300。

7.然後,vlan已經添加,但還沒有任何交換機的.介面歸屬於這個vlan,也就是說這個vlan沒有任何意義。所以,下一步就是添加一個交換機介面到這個vlan 300。

進入全局配置模式,把Fa0/1介面的模式配置為access,並歸屬於vlan 300,具體命令為:

Switch(config)#int fa0/1

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 300

8.接著,回到特權模式,執行命令」show vlan「查看當前的vlan配置信息,可以發現,介面Fa0/1已經被劃分到了vlan 300。

9.然後,就是配置vlan 300的IP地址信息了,執行命令:

Switch(config)#int vlan 300

Switch(config-if)#ip address 10.10.10.254 255.255.255.0

10.最後,在特權模式下,執行命令」show running-config「查看vlan的相關信息。到這里,整個vlan的配置過程就完成了。

拓展閱讀

1.switch(config)#interface vlan 1 進入vlan 1

2.switch(config-if)#ip address 設置IP地址

3.switch(config-if)#ip default-gateway 設置默認網關

4.switch(config)#line vty 0 4 進入虛擬終端

5.switch(config-line)#login 允許登錄

6.switch(config-line)#password xx 設置登錄口令

7.switch#exit 返回命令

8.Cisco交換機命令之控制台口令

9.switch(config)#line console 0 進入控制台口

10.switch(config-line)#login 允許登錄

11.switch(config-line)#password xx 設置登錄口令

12.switch#exit 返回命令

13.Cisco交換機命令之基本介面配置

14.switch(config)#interface f0/1 進入f0/1介面

15.switch(config-if)#plex full 配置全雙工模式

16.switch(config-if)#speed 100 配置速率

17.switch(config-if)#description to*****介面描述

18.switch(config)#ip domain-name***.com 設置或名伺服器

19.switch(config)#mac-address-table aging-time 設置mac表超時時間

20.switch#write 保存配置信息

21.switch# running-config startup-config 保存當前配置nvram

22.switch#erase startup-config 清除配置文件

23.Cisco交換機命令之交換機VLAN設置:

24.#vlan database 進入VLAN設置

25.switch(vlan)#vlan 2 建VLAN 2

26.switch(vlan)#name 名字 建VLAN 2的名稱

27.switch(vlan)#no vlan 2 刪vlan 2

注:刪除vlan時原屬於此vlan的埠處於非激活狀態,直到重新分配為止。

28.switch(config)#int f0/1 進入埠1

29.switch(config-if)#switchport mode access 當前埠工作莫試

30.switch(config-if)#switchport access vlan 2 當前埠加入vlan 2

31.switch(config-if)#switchport mode trunk 設置為干線

32.switch(config-if)#switchport trunk encapsulation dot1q 設置vlan 中繼協議

33.switch(config-if)#no switchport mode 或 ( switchport mode access) 禁用干線

34.switch(config-if)#switchport trunk allowed vlan add 1,2 ; 從Trunk中添加vlans

35.switch(config-if)#switchport trunk allowed vlan remove 1,2 ;從Trunk中刪除vlans

36.switch(config-if)#switchport trunk pruning vlan remove 1,2 ;從Trunk中關閉局部修剪

Cisco交換機命令之乙太網通道配置

1.switch(config)#interface range fasternet0/1 - 2 將fasternet0/1和0/2 口捆綁

2.switch(config-if)#channel-group 1 mode on 配置以太通道模式

3.switch(config-if)#port-channel load-balance {dst-mac | src-mac}在鏈路間實現負載均衡

4.switch#show etherchannel 1 summary 查看通道信息

5.switch#show etherchannel load-balance 查看通道信息

6.Cisco交換機命令之vtp配置

7.switch(config)#vtp domain 設置vtp域名

8.switch(config)#vtp password 設置vtp密碼

9.switch(config)#vtp mode server 設置vtp伺服器模式

10.switch(config)#vtp mode client 設置vtp客戶機模式

11switch(config)#vtp mode transparent 設置vtp 透明模式

12.switch(config)#vtp version 設置vtp版本

13.switch(config)#vtp pruning 啟用vtp修解

14.switch(config)#no vtp pruning 關閉vtp修解

注:要想從vtp中減少一台交換機只需將該交換機vtp 名更改

Cisco交換機命令之生成樹stp:

1.switch(config)#spanning-tree vlan 啟用stp生成樹(基於vlan)

2.switch(config)#spanning-tree vlan root primary 指定根交換機(基於vlan)

3.switch(config)#spanning-tree vlan root secondary 指定備用根交換機(基於vlan)

4.switch(config)#spanning-tree vlan priority 指定交換機優先順序(基於vlan)

5.switch(config)#no spanning-tree vlan priority 將交換機的優先順序恢復默認值(基於vlan)

6.switch(config-if)#spanning-tree vlan cost 指定埠成本(起用trunk的埠模式下)

7.switch(config-if)#spanning-tree vlan port-prioty 指定交換機埠優先順序(基於vlan)

8.switch(config-if)#spanning-tree portfast 配置速埠(連接終端設備的埠狀態)如pc機

9.switch(config)#spanning-tree uplinkfast 配置上行速埠

10.switch(config)#spanning-tree vlan hello-time 配置交換機hello時間(基於vlan)

11.switch(config)#spanning-tree vlan forward-time 修改轉發延遲計時器(基於vlan)

12.switch(config)#spanning-tree vlan max-time 修改最大老化時間(基於vlan)

13.switch#show spanning-tree summery 檢測vlan生成樹配置

14.switch#show spanning-tree vlan detail 瀏覽詳細生成樹配置信息

15.switch#show spanning-tree interface detail 瀏覽詳細生成樹埠配置信息

16.Cisco交換機命令之交換機顯示命令:

17.switch#show vtp status 查看vtp配置信息

18.switch#show running-config 查看當前配置信息

19.switch#show vlan 查看vlan配置信息

20.switch#show interface 查看埠信息

21.switch#show int f0/0 查看指定埠信息

22.switch#dir flash: 查看快閃記憶體

23.switch#show version 查看當前版本信息

24.switch#show mac-address-table aging-time 查看mac超時時間

25.switch#show cdp cisco設備發現協議 (可以查看聆接設備)

26.switch#show cdp traffic 杳看接收和發送的cdp包統計信息

27.switch#show cdp neighbors 查看與該設備相鄰的cisco設備

28.switch#show interface f0/1 switchport 查看有關switchport的配置

29switch#show cdp neighbors 查看與該設備相鄰的cisco設備

⑨ 如何配置VTP

方法/步驟

閱讀全文

與創建vtp域的命令相關的資料

熱點內容
基於單片機的遙控器設計 瀏覽:517
安卓如何取消圓圖標 瀏覽:11
收件伺服器怎麼樣 瀏覽:48
建築設計規范pdf 瀏覽:98
如何合並兩個pdf 瀏覽:174
刷機包必須要解壓的單詞 瀏覽:483
android課表實現 瀏覽:864
頭條app在哪裡能看見有什麼活動 瀏覽:511
冰櫃壓縮機電容80歐 瀏覽:609
安卓各個版本圖標什麼樣 瀏覽:152
無錫哪裡有製作手機app 瀏覽:538
php字元串轉json數組 瀏覽:6
數控網路編程課程有哪些 瀏覽:482
python30特效程序編碼 瀏覽:392
安卓跟蘋果互傳照片用什麼 瀏覽:848
原創小說app哪個好看 瀏覽:97
首台湖南造鯤鵬伺服器雲伺服器 瀏覽:268
redhatphp 瀏覽:456
android智能家居藍牙 瀏覽:646
pt螺紋編程 瀏覽:451