当前位置:文档之家› 关于LAN网内VLAN与Trunk的详细配置

关于LAN网内VLAN与Trunk的详细配置

关于LAN网内VLAN与Trunk的详细配置
关于LAN网内VLAN与Trunk的详细配置

关于LAN网内VLAN与Trunk的详细配置

此实验过程是在Boson NetSim for CCNP version 6.0 BETA 1软件下做的。其中使用2台C2905switch和4台PC机。

实验内容:

1、配置控制端口和虚拟线路

2、设置VLAN两个,分别为:VLAN100 Pcontrol和VLAN200 Accout

3、分别将接口加入到VLAN100和VLAN200后配置Trunk线路,保证VLAN间的通信

4、最后进行测试是否成功

关于LAN网内VLAN与Trunk的详细配置

SW1(C2950)交换机测试详细步骤及结果:

CLI session with the switch is open.

To end the CLI session, enter [Exit].

Switch>

%LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/4, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/5, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/6, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/7, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/7, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/8, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/8, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/9, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/9, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/11, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/11, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/12, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/12, changed state to down Switch>enable

Switch#show version

Boson Operating Simulation Software

BOSS (tm) C2900 Software (C2900-Enterprise), Version 12.1, RELEASE SOFTWARE Copyright (c) 1998-2003 by Boson Software, Inc.

BOSS ROM: System Bootstrap, Version 12.2, RELEASE SOFTWARE

Switch Uptime Is 0 days, 0 hours, 0 minutes

System restarted by power-on

System image file is ""flash:c2900-enterprise.12.1.boss"", booted via flash

Boson 2900 (BOSS) processor (revision 5.0)

12 FastEthernet/IEEE 802.3 interface(s)

32K bytes of simulated non-volatile configuration memory.

8192K bytes of simulated System flash (Read/Write)

Switch#

Switch#

Switch#show runn

!

Version 12.1

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname Switch

!

!

!

ip subnet-zero

spanning-tree extend system-id

!

!

!

!

!

!

!

!

interface FastEthernet0/1

!

interface FastEthernet0/2

Switch#show runn

!

Version 12.1

service timestamps debug uptime service timestamps log uptime no service password-encryption !

hostname Switch

!

!

!

ip subnet-zero

spanning-tree extend system-id !

!

!

!

!

!

!

!

interface FastEthernet0/1

!

interface FastEthernet0/2

!

interface FastEthernet0/3

!

interface FastEthernet0/4

!

interface FastEthernet0/5

!

interface FastEthernet0/6

!

interface FastEthernet0/7

!

interface FastEthernet0/8

!

interface FastEthernet0/9

!

interface FastEthernet0/10

!

interface FastEthernet0/11

interface FastEthernet0/12

!

vtp domain bigdomain

!

interface Vlan 1

no ip address

no ip route-cache

!

!

ip classless

no ip http server

!

!

!

!

line con 0

transport input none

line aux 0

line vty 0 15

!

no scheduler allocate

end

Switch#

Switch#

Switch#configure terminal

Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname SW1

SW1(config)#line console 0

SW1(config-line)#exec-timeout 20 0

SW1(config-line)#logging synchronous

SW1(config-line)#password dsfeng

SW1(config-line)#login

SW1(config-line)#line vty 0 15

SW1(config-line)#exec-timeout 15 0

SW1(config-line)#logging synchronous

SW1(config-line)#password dsfeng

SW1(config-line)#login

SW1(config-line)#enable secret cisco

SW1(config)#exit

SW1#

SW1#

SW1#vlan database

SW1(vlan)#vlan 100 name Pcontrol

VLAN 100 added:

Name:Pcontrol

SW1(vlan)#vlan 200 name Accout

VLAN 200 added:

Name:Accout

SW1(vlan)#exit

APPL Y completed.

Exiting....

SW1#

SW1#

SW1#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

SW1(config)#interface fastethernet 0/2

SW1(config-if)#switchport mode access

SW1(config-if)#switchport access vlan 100

SW1(config-if)#exit

SW1(config)#interface fastethernet 0/3

SW1(config-if)#switchport mode access

SW1(config-if)#switchport access vlan 200

SW1(config-if)#exit

SW1(config)#interface fasteterhent 0/10

SW1(config-if)#switchport mode trunk

SW1(config-if)#switchport trunk encapsulation dot1q

SW1(config-if)#end

SW1#

SW1#

SW1#show interface fastethernet 0/2

FastEthernet0/2 is up, line protocol is up

Hardware is Fast Ethernet, address is 000C.6542.9093 (bia 000C.6542.9093) MTU 1500 bytes, BW 10000 Kbit, DL Y 1000 usec,

reliability 255/255, txload 1/255, rxload 1/255

Auto-duplex, Auto-speed

Encapsulation ARPA, loopback not set

ARP type: ARPA, ARP Timeout 04:00:00

Last input 02:29:44, output never, output hang never

Last clearing of "show interface" counters never

Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo

Output queue :0/40 (size/max)

5 minute input rate 0 bits/sec, 0 packets/sec

5 minute output rate 0 bits/sec, 0 packets/sec

269 packets input, 71059 bytes, 0 no buffer

Received 6 broadcasts, 0 runts, 0 giants, 0 throttles

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored

7290 packets output, 429075 bytes, 0 underruns

0 output errors, 3 interface resets

0 output buffer failures, 0 output buffers swapped out

SW1#

SW1#

SW1#show interface fastethernet 0/3

FastEthernet0/3 is up, line protocol is up

Hardware is Fast Ethernet, address is 000C.3849.2796 (bia 000C.3849.2796) MTU 1500 bytes, BW 10000 Kbit, DL Y 1000 usec,

reliability 255/255, txload 1/255, rxload 1/255

Auto-duplex, Auto-speed

Encapsulation ARPA, loopback not set

ARP type: ARPA, ARP Timeout 04:00:00

Last input 02:29:44, output never, output hang never

Last clearing of "show interface" counters never

Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo

Output queue :0/40 (size/max)

5 minute input rate 0 bits/sec, 0 packets/sec

5 minute output rate 0 bits/sec, 0 packets/sec

269 packets input, 71059 bytes, 0 no buffer

Received 6 broadcasts, 0 runts, 0 giants, 0 throttles

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored

7290 packets output, 429075 bytes, 0 underruns

0 output errors, 3 interface resets

0 output buffer failures, 0 output buffers swapped out

SW1#

SW1#

SW1#show interface fastethernet 0/10

FastEthernet0/10 is up, line protocol is up

Hardware is Fast Ethernet, address is 000C.3878.9745 (bia 000C.3878.9745) MTU 1500 bytes, BW 10000 Kbit, DL Y 1000 usec,

reliability 255/255, txload 1/255, rxload 1/255

Auto-duplex, Auto-speed

Encapsulation ARPA, loopback not set

ARP type: ARPA, ARP Timeout 04:00:00

Last input 02:29:44, output never, output hang never

Last clearing of "show interface" counters never

Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo

Output queue :0/40 (size/max)

5 minute input rate 0 bits/sec, 0 packets/sec

5 minute output rate 0 bits/sec, 0 packets/sec

269 packets input, 71059 bytes, 0 no buffer

Received 6 broadcasts, 0 runts, 0 giants, 0 throttles

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored

7290 packets output, 429075 bytes, 0 underruns

0 output errors, 3 interface resets

0 output buffer failures, 0 output buffers swapped out

SW1#

SW1#

SW1#show vlan

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/6

Fa0/7, Fa0/8, Fa0/9, Fa0/10

Fa0/11, Fa0/12

100 Pcontrol active Fa0/2

200 Accout active Fa0/3

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

1 enet 100001 1500 - - - - - 0 0

100 enet 100100 1500 - - - - - 0 0

200 enet 100200 1500 - - - - - 0 0

1002 fddi 101002 1500 - - - - - 0 0

1003 tr 101003 1500 - - - - - 0 0

1004 fdnet 101004 1500 - - - ieee - 0 0

1005 trnet 101005 1500 - - - ibm - 0 0

SW1#

SW1#

SW1#show cdp neighbors

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge

S -Switch, H - Host, i - IGMP, r - Repeater

Device ID Local Intrfce Holdtme Capability Platform Port ID

SW2 Fas0/10 167 T S 2950 Fas 0/10

SW1#

SW1#

SW1#show mac-address-table

Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge

S -Switch, H - Host, i - IGMP, r - Repeater

Device ID Local Intrfce Holdtme Capability Platform Port ID

SW2 Fas0/10 167 T S 2950 Fas 0/10

Mac Address Table

------------------------------------------

Vlan Mac Address Type Ports

---- ----------- ---- -----

200 000C.9631.1997 DYNAMIC Fa0/3

100 000C.7036.8702 DYNAMIC Fa0/2

1 000C.3817.841

2 DYNAMIC Fa0/10

1 000C.9623.5011 DYNAMIC Fa0/10

1 000C.1738.3819 DYNAMIC Fa0/10

Total Mac Addresses for this criterion: 5

SW1#

SW1#

SW1#show run

!

Version 12.1

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname SW1

enable secret 5 $sdf$6978yhg$jnb76sd

!

!

!

ip subnet-zero

spanning-tree extend system-id

!

!

!

!

!

!

!

!

interface FastEthernet0/1

!

interface FastEthernet0/2 switchport mode access switchport access vlan 100

!

interface FastEthernet0/3 switchport mode access switchport access vlan 200

!

interface FastEthernet0/4

!

interface FastEthernet0/5

!

interface FastEthernet0/6

!

interface FastEthernet0/7

!

interface FastEthernet0/8

!

interface FastEthernet0/9

!

interface FastEthernet0/10 switchport mode trunk

switchport trunk encapsulation dot1q !

interface FastEthernet0/11

!

interface FastEthernet0/12

!

vtp domain bigdomain

!

interface Vlan 1

no ip address

no ip route-cache

!

vlan 100 name Pcontrol

vlan 200 name Accout

!

ip classless

no ip http server

!

!

!

!

line con 0

login

transport input none

password dsfeng

exec-timeout 15 0

logging synchronous

line aux 0

line vty 0 15

login

password dsfeng

!

no scheduler allocate

end

SW1#

SW1#

SW1#copy running-config startup-config

Destination filename [startup-config]?

Building configuration...

[OK]

SW1#

SW1#

SW2(C2950)交换机测试详细步骤及结果:

CLI session with the switch is open.

To end the CLI session, enter [Exit].

%LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/4, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/5, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/6, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/7, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/7, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/8, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/8, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/9, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/9, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/11, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/11, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/12, changed state to down

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/12, changed state to down Switch>

Switch>enable

Switch#show version

Boson Operating Simulation Software

BOSS (tm) C2900 Software (C2900-Enterprise), Version 12.1, RELEASE SOFTWARE Copyright (c) 1998-2003 by Boson Software, Inc.

BOSS ROM: System Bootstrap, Version 12.2, RELEASE SOFTWARE

Switch Uptime Is 0 days, 0 hours, 5 minutes

System restarted by power-on

System image file is ""flash:c2900-enterprise.12.1.boss"", booted via flash

Boson 2900 (BOSS) processor (revision 5.0)

12 FastEthernet/IEEE 802.3 interface(s)

32K bytes of simulated non-volatile configuration memory.

8192K bytes of simulated System flash (Read/Write)

Switch#

Switch#

Switch#show runn

!

Version 12.1

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname Switch

!

!

!

ip subnet-zero

spanning-tree extend system-id !

!

!

!

!

!

!

!

interface FastEthernet0/1

!

interface FastEthernet0/2

!

interface FastEthernet0/3

!

interface FastEthernet0/4

!

interface FastEthernet0/5

!

interface FastEthernet0/6

!

interface FastEthernet0/7

!

interface FastEthernet0/8

!

interface FastEthernet0/9

!

interface FastEthernet0/10

!

interface FastEthernet0/11

!

interface FastEthernet0/12

!

vtp domain bigdomain

!

interface Vlan 1

no ip address

no ip route-cache

!

!

ip classless

no ip http server

!

!

!

!

line con 0

transport input none

line aux 0

line vty 0 15

!

no scheduler allocate

end

Switch#

Switch#

Switch#configure terminal

Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname SW2

SW2(config)#line console 0

SW2(config-line)#exec-timeout 20 0

SW2(config-line)#logging synchronous

SW2(config-line)#password dsfeng

SW2(config-line)#login

SW2(config-line)#line vty 0 15

SW2(config-line)#exec-timeout 15 0

SW2(config-line)#logging synchronous

SW2(config-line)#password dsfeng

SW2(config-line)#login

SW2(config-line)#enable secret cisco

SW2(config)#end

SW2#

SW2#

SW2#vlan database

SW2(vlan)#vlan 100 name Pcontrol

VLAN 100 added:

Name:Pcontrol

SW2(vlan)#vlan 200 name Accout

VLAN 200 added:

Name:Accout

SW2(vlan)#exit

APPL Y completed.

Exiting....

SW2#

SW2#

SW2#configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

SW2(config)#interface fastethernet 0/2

SW2(config-if)#switchport mode access

SW2(config-if)#switchport access vlan 100

SW2(config-if)#exit

SW2(config)#interface fastethernet 0/3

SW2(config-if)#switchport mode access

SW2(config-if)#switchport access vlan 200

SW2(config-if)#exit

SW2(config)#interface fastethernet 0/10

SW2(config-if)#switchport mode trunk

SW2(config-if)#switchport trunk encapsulation dot1q

SW2(config-if)#end

SW2#

SW2#

SW2#show interface fastethernet 0/2

FastEthernet0/2 is up, line protocol is up

Hardware is Fast Ethernet, address is 000C.2018.9057 (bia 000C.2018.9057) MTU 1500 bytes, BW 10000 Kbit, DL Y 1000 usec,

reliability 255/255, txload 1/255, rxload 1/255

Auto-duplex, Auto-speed

Encapsulation ARPA, loopback not set

ARP type: ARPA, ARP Timeout 04:00:00

Last input 02:29:44, output never, output hang never

Last clearing of "show interface" counters never

Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo

Output queue :0/40 (size/max)

5 minute input rate 0 bits/sec, 0 packets/sec

5 minute output rate 0 bits/sec, 0 packets/sec

269 packets input, 71059 bytes, 0 no buffer

Received 6 broadcasts, 0 runts, 0 giants, 0 throttles

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored

7290 packets output, 429075 bytes, 0 underruns

0 output errors, 3 interface resets

0 output buffer failures, 0 output buffers swapped out

SW2#

SW2#

SW2#show interface fastethernet 0/3

FastEthernet0/3 is up, line protocol is up

Hardware is Fast Ethernet, address is 000C.4287.4991 (bia 000C.4287.4991) MTU 1500 bytes, BW 10000 Kbit, DL Y 1000 usec,

reliability 255/255, txload 1/255, rxload 1/255

Auto-duplex, Auto-speed

Encapsulation ARPA, loopback not set

ARP type: ARPA, ARP Timeout 04:00:00

Last input 02:29:44, output never, output hang never

Last clearing of "show interface" counters never

Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo

Output queue :0/40 (size/max)

5 minute input rate 0 bits/sec, 0 packets/sec

5 minute output rate 0 bits/sec, 0 packets/sec

269 packets input, 71059 bytes, 0 no buffer

Received 6 broadcasts, 0 runts, 0 giants, 0 throttles

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored

7290 packets output, 429075 bytes, 0 underruns

0 output errors, 3 interface resets

0 output buffer failures, 0 output buffers swapped out

SW2#

SW2#

SW2#show interface fastethernet 0/10

FastEthernet0/10 is up, line protocol is up

Hardware is Fast Ethernet, address is 000C.3817.8412 (bia 000C.3817.8412) MTU 1500 bytes, BW 10000 Kbit, DL Y 1000 usec,

reliability 255/255, txload 1/255, rxload 1/255

Auto-duplex, Auto-speed

Encapsulation ARPA, loopback not set

ARP type: ARPA, ARP Timeout 04:00:00

Last input 02:29:44, output never, output hang never

Last clearing of "show interface" counters never

Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo

Output queue :0/40 (size/max)

5 minute input rate 0 bits/sec, 0 packets/sec

5 minute output rate 0 bits/sec, 0 packets/sec

269 packets input, 71059 bytes, 0 no buffer

Received 6 broadcasts, 0 runts, 0 giants, 0 throttles

0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored

7290 packets output, 429075 bytes, 0 underruns

0 output errors, 3 interface resets

0 output buffer failures, 0 output buffers swapped out

SW2#

SW2#

SW2#show vlan

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/6

Fa0/7, Fa0/8, Fa0/9, Fa0/10

Fa0/11, Fa0/12

100 Pcontrol active Fa0/2

200 Accout active Fa0/3

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

1 enet 100001 1500 - - - - - 0 0

100 enet 100100 1500 - - - - - 0 0

200 enet 100200 1500 - - - - - 0 0

1002 fddi 101002 1500 - - - - - 0 0

1003 tr 101003 1500 - - - - - 0 0

1004 fdnet 101004 1500 - - - ieee - 0 0

1005 trnet 101005 1500 - - - ibm - 0 0

SW2#

SW2#

SW2#show mac-address-table

VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/1, Fa0/4, Fa0/5, Fa0/6

Fa0/7, Fa0/8, Fa0/9, Fa0/10

Fa0/11, Fa0/12

100 Pcontrol active Fa0/2

200 Accout active Fa0/3

1002 fddi-default active

1003 token-ring-default active

1004 fddinet-default active

1005 trnet-default active

VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------

1 enet 100001 1500 - - - - - 0 0

100 enet 100100 1500 - - - - - 0 0 200 enet 100200 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0

Mac Address Table

------------------------------------------

Vlan Mac Address Type Ports

---- ----------- ---- -----

200 000C.1738.3819 DYNAMIC Fa0/3

100 000C.9623.5011 DYNAMIC Fa0/2

1 000C.3878.9745 DYNAMIC Fa0/10

1 000C.7036.870

2 DYNAMIC Fa0/10

1 000C.9631.1997 DYNAMIC Fa0/10

Total Mac Addresses for this criterion: 5

SW2#

SW2#

SW2#show runn

!

Version 12.1

service timestamps debug uptime

service timestamps log uptime

no service password-encryption

!

hostname SW2

enable secret 5 $sdf$6978yhg$jnb76sd

!

!

!

ip subnet-zero

spanning-tree extend system-id

!

!

!

!

!

!

!

!

interface FastEthernet0/1

!

interface FastEthernet0/2 switchport mode access switchport access vlan 100

!

interface FastEthernet0/3 switchport mode access switchport access vlan 200

!

interface FastEthernet0/4

!

interface FastEthernet0/5

!

interface FastEthernet0/6

!

interface FastEthernet0/7

!

interface FastEthernet0/8

!

interface FastEthernet0/9

!

interface FastEthernet0/10 switchport mode trunk

switchport trunk encapsulation dot1q !

interface FastEthernet0/11

!

interface FastEthernet0/12

!

vtp domain bigdomain

!

interface Vlan 1

no ip address

no ip route-cache

!

vlan 100 name Pcontrol

vlan 200 name Accout

!

ip classless

no ip http server

!

!

!

!

line con 0

login

transport input none

password dsfeng

exec-timeout 15 0

logging synchronous

line aux 0

line vty 0 15

login

password dsfeng

!

no scheduler allocate

end

SW2#

SW2#

SW2#copy running-config startup-config

Destination filename [startup-config]?

Building configuration...

[OK]

SW2#

SW2#

PC1测试结果:

Boson BOSS 5.0

Copyright 1998-2005 Boson Software, Inc.

Use the command help to get started

Press Enter to begin

C:>

C:>ipconfig /ip 192.168.1.1 255.255.255.0

C:>ping 192.168.1.2

Pinging 192.168.1.2 with 32 bytes of data:

Reply from 192.168.1.2: bytes=32 time=60ms TTL=241 Reply from 192.168.1.2: bytes=32 time=60ms TTL=241

Reply from 192.168.1.2: bytes=32 time=60ms TTL=241

Reply from 192.168.1.2: bytes=32 time=60ms TTL=241

Reply from 192.168.1.2: bytes=32 time=60ms TTL=241

Ping statistics for 192.168.1.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:

Minimum = 50ms, Maximum = 60ms, Average = 55ms

PC2测试结果:

Boson BOSS 5.0

Copyright 1998-2005 Boson Software, Inc.

Use the command help to get started

Press Enter to begin

C:>ipconfig /ip 192.168.10.1 255.255.255.0

C:>

C:>ping 192.168.10.2

Pinging 192.168.10.2 with 32 bytes of data:

Reply from 192.168.10.2: bytes=32 time=60ms TTL=241

Reply from 192.168.10.2: bytes=32 time=60ms TTL=241

Reply from 192.168.10.2: bytes=32 time=60ms TTL=241

Reply from 192.168.10.2: bytes=32 time=60ms TTL=241

Reply from 192.168.10.2: bytes=32 time=60ms TTL=241

Ping statistics for 192.168.10.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:

Minimum = 50ms, Maximum = 60ms, Average = 55ms

PC3测试结果:

Boson BOSS 5.0

Copyright 1998-2005 Boson Software, Inc.

Use the command help to get started

Press Enter to begin

C:>ipconfig /ip 192.168.1.2 255.255.255.0

C:>ping 192.168.1.1

Pinging 192.168.1.1 with 32 bytes of data:

VLAN工作原理详解

VLAN工作原理(VLAN通信原理)详解 VLAN工作原理即VLAN通信原理 1、vlan基本通信原理 为了提高处理效率,交换机内部的数据帧一律都带有VLAN Tag,以统一方式处理。当一个数据帧进入交换机接口时,如果没有带VLAN Tag,且该接口上配置了PVID(Port Default VLAN ID),那么,该数据帧就会被标记上接口的PVID。如果数据帧已经带有VLAN Tag,那么,即使接口已经配置了PVID,交换机不会再给数据帧标记VLAN Tag。 由于接口类型不同,交换机对数据帧的处理过程也不同。下面根据不同的接口类型分别介绍。

由于设备所有的接口都默认加入VLAN1,因此当网络中存在VLAN1的未知单播、组播或者广播报文时,可能会引起广播风暴。对于不需要加入VLAN1的接口及时退出VLAN1,避免环路。 2、VLAN内跨越交换机通信原理 有时属于同一个VLAN的用户主机被连接在不同的交换机上。当VLAN跨越交换机时,就需要交换机间的接口能够同时识别和发送跨越交换机的VLAN报文。这时,需要用到Trunk Link技术。 Trunk Link有两个作用: 1、中继作用: 把VLAN报文透传到互联的交换机。 2、干线作用: 一条Trunk Link上可以传输多个VLAN的报文。 图1 Trunk Link通信方式示意图 例如在上图1所示的网络中,为了让DeviceA和DeviceB之间的链路既支持VLAN2内的用户通讯又支持VLAN3内的用户通讯,需要配置连接接口同时加入两个VLAN。 即应配置DeviceA的以太网接口Port2和DeviceB的以太网接口Port1同时加入VLAN2和VLAN3。 当用户主机Host A发送数据给用户主机Host B时,数据帧的发送过程如下:数据帧首先到达DeviceA的接口Port4。

实验5 交换机VLAN的划分和配置实验

实验5 交换机VLAN 的划分和配置实验 一、实验目的 1. 了解VLAN 的相关技术 2. 熟悉华为交换机VLAN 的划分和配置 3. 熟悉交换机VLAN Trunk 的配置 二、实验环境 1、使用Console 口配置交换机 Console 口配置连接较为简单,只需要用专用配置电缆将配置用主机通信串口和路由器的Console 口连接起来即可,其配置连接如图1所示: 图1 Console 口配置交换机 配置时使用Windows 操作系统附带的超级终端软件进行命令配置,其具体操作步骤如下: (1) 首先启动超级终端,点击windows 的开始 →程序→附件→通讯→超 级终端,启动超级终端; (2) 根据提示输入连接描述名称后确定,在选择连接时使用COM1后单击 “确定”按钮将弹出如图2所示的端口属性设置窗口,并按照如下参数设定串口属性后单击“确定”按钮。 图2 超级终端串口属性配置 此时,我们已经成功完成超级终端的启动。如果您已经将线缆按照要求连接 consol e

好,并且交换机已经启动,此时按Enter键,将进入交换机的用户视图并出现如下标识符: 2、实验环境搭建(使用华为网络配置模拟软件HW-RouteSim 3.0) 华为S3026交换机二台,Linux操作系统PC机四台,Console控制线二根,直连网络线及电源线若干。按照下图进行连接,并完成配置。 图1 VLAN配置实验网络拓扑图 三、实验原理 1、VLAN简介 ●VLAN(Virtual Local Area Network),是一种通过将局域网内的设备逻辑 地而不是物理地划分成一个个网段从而实现虚拟工作组的技术,IEEE于1999年颁布了用以标准化VLAN实现方案的IEEE 802.1Q协议标准。 ●VLAN技术允许网络管理者将一个物理的LAN逻辑地划分成不同的广播 域(或称虚拟LAN,即VLAN),每一个VLAN都包含一组有着相同需求的计算机,由于VLAN是逻辑地而不是物理地划分,所以同一个VLAN内的各个计算机无须放置在同一个物理空间里,即这些计算机不一定属于同一个物理LAN网段(跨交换机)。 ●VLAN的优势在于VLAN内部的广播和单播流量不会被转发到其它VLAN 中,从而有助于控制网络流量、减少设备投资、简化网络管理、提高网络安全性。 ●冲突域(广播域) ●

交换机配置命令

交换机配置命令 Prepared on 24 November 2020

配置命令 交换机之间用交叉线 1进入特权模式:Switch>enable 2配置模式 Switch#config 3配置主机名:Switch(config)#hostname S1 4.设置访问口令S1#configure terminal S1(config)#line console 0 S1(config-line)#password cisco S1(config-line)#login S1(config-line)#line vty 0 15 S1(config-line)#password cisco S1(config-line)#login S1(config-line)#exit 5.将使能加密口令设置为 class。 S1(config)#enable secret class S1(config)#配置默认网关 6.在虚拟接口vlan99设置交换机ip地址 S1(config)#interface vlan99 S1(config-if)# S1(config-if)#no shutdown S1(config-if)#exit 7.交换机 VLAN 分配端口 S1(config)#interface fa0/1 S1(config-if)#switchport mode access S1(config-if)#switchport access vlan 99 S1(config-if)#exit 8.给vlan命名 S1(config)#vlan 10 S1(config-vlan)#name Faculty/Staff .本征vlan即分配端口连接s1 使用中继vlan S1中继vlan S1(config)#interface FastEthernet 0/1 S1(config-if)#switchport mode trunk S1(config-if)#switchport trunk native vlan 99 9..设置交换机默认网关

锐捷 CISCO 交换机配置命令

锐捷CISCO 交换机配置命令。 交换机配置模式主要有: 用户模式:此模式只可以简单的查看一些交换机的配置和一些简单的修改。 Switch> 特权模式:此模式可以查看一些交换机的配置,后面讲述的很多show命令便是在此模式下进行的,还可以对一些简单的设置配置,例如时间。 Switch> enable //在用户模式下输入enable将进入配置模式 Switch# 全局配置模式:此模式下可以进行对交换机的配置,例如:命名、配置密码、设路由等。Switch#configure erminal //特权模式下可以通过config terminal 命令进入配置模式 Switch(config)# 端口配置模式:此模式下对端口进行配置,如配置端口ip等。 Switch(config)#interface gigabitEthernet 1/1 //配置模式下输入interface gigabitEthernet 1/1进入到端口g 1/1接口模式。 二、交换机基本配置 交换机命名: 在项目实施的时候,建议为处于不同位置的交换机命名,便于记忆,可提高后期管理效率。switch(config)#hostname ruijie //ruijie为该交换机的名字 交换机配置管理密码: 配置密码可以提高交换机的安全性,另外,telnet登录交换机的时候,必须要求有telnet管理密码。 switch (config)#enable secret level 1 0 rg //配置telnet管理密码为rg,其中1表示telnet密码,0表示密码不加密 switch (config)#enable secret level 15 0 rg //配置特权模式下的管理密码rg,其中15表示为特权密码 交换机配置管理IP switch (config)#interface vlan 1 //假设管理VLAN为VLAN 1 switch (config-if)#ip address 192.168.1.1 255.255.255.0 //给管理VLAN配置管理IP地址switch (config-if)#no shutdown //激活管理IP,养成习惯,无论配置什么设备,都使用一下这个命令 交换机配置网关: switch(config)#ip default-gateway 192.168.1.254 //假设网关地址为192.168.1.254,此命令用户二层设备。 通过以上几个命令的配置,设备便可以实现远程管理,在项目实施时(尤其是设备位置比较分散)特别能提高效率。 2.1 接口介质类型配置 锐捷为了降低SME客户的总体拥有成本,推出灵活选择的端口形式:电口和光口复用接口,方便用户根据网络环境选择对应的介质类型。 但光口和电口同时只能用其一,如图1,如使用了光口1F,则电口1不能使用。 图1 接口介质类型的转换: Switch(config)#interface gigabitethernet 0/1

交换机Vlan配置

实验三交换机的VLAN配置 一、实验目的 1. 理解理解Trunk链路的作用和VLAN的工作原理 2. 掌握交换机上创建VLAN、接口分配 3.掌握利用三层交换机实现VLAN间的路由的方法。 二、实验环境 本实验在实验室环境下进行操作,需要的设备有:配置网卡的PC机若干台,双绞线若干条,CONSOLE线缆若干条,思科交换机cisco 2960两台。 三、实验容 1. 单一交换机的VLAN配置; 2. 跨交换机VLAN配置,设置Trunk端口; 3. 测试VLAN分配结果; 4.在三层交换机上实现VLAN的路由; 5.测试VLAN间的连通性 四、实验原理 1.什么是VLAN VLAN是建立在局域网交换机上的,以软件方式实现逻辑工作组的划分与管理,逻辑工作组的站点不受物理位置的限制,当一个站点从一个逻辑工作组移到另一个逻辑工作组时,只需要通过软件设定,而不需要改变它在网络中的物理位置;当一个站点从一个物理位置移动到另一个物理位置时,只要将该计算机连入另一台交换机,通过软件设定后该计算机可成为原工作组的一员。 相同VLAN的主机可以相互直接通信,不同VLAN中的主机之间不能直接通信,需要借助于路由器或具有路由功能的第三层交换机进行转发。广播数据包只可以在本VLAN进行广播,不能传输到其他VLAN中。 2.交换机的端口 以太网交换机的每个端口都可以分配给一个VLAN,分配给同一个VLAN的端口共享广播域,即一个站点发送广播信息,同一VLAN中的所有站点都可以接收到。 交换机一般都有三种类型的端口:TRUNK口、ACCESS口、CONSOLE口。 ?CONSOLE端口:它是专门用于对交换机进行配置和管理的。通过Console 端口连接并配置交换机,是配置和管理交换机必须经过的步骤。 ?ACCESS口(默认):ACCESS端口只能通过缺省VLAN ID的报文。

VLAN透传配置举例

目录1 介绍 特性简介 特性关键技术点 2 特性使用指南 使用场合 配置指南 配置混合模式桥组 注意事项 3 配置举例 VLAN透传典型应用组网 组网需求 物理连接图 配置步骤 SecPath F100-A VLAN透传组网 组网需求 物理连接图 配置步骤 故障排除 故障排除命令 故障现象举例 4 关键命令 bridge enable bridge bridge-set enable

bridge vlanid-transparent-transmit enable insulate 5 相关资料 其它相关资料

1 介绍 特性简介 在混合模式下,桥支持VLAN ID透传特性是指:通过对加入桥组的设备出接口配置支持VLAN ID透传,可以使报文从该接口送出时,不对报文的VLAN ID做任何修改。 使能桥出接口VLAN ID透传,则报文从该接口发出时保留报文入桥时的VLAN ID,如果没有VLAN ID不增加VLAN ID。 特性关键技术点 配置了VLAN透传后,防火墙不会对报文的VLAN tag进行任何的修改和去除等操作。从而可以实现VLAN tag的透明传输,保证不同VLAN之间的隔离、同一VLAN 之间的互通。 2 特性使用指南 使用场合 当系统中存在VLAN部署,不同的VLAN之间需要进行隔离,而且所有VLAN的防火墙策略(比如配置在接口上的防火墙包过滤)是一样的。 配置指南 混合模式下桥接功能的配置步骤分为以下几步: 使能桥组功能 使能一个桥组。 将接口加入到桥组中 使能桥组下接口的VLAN透传功能 2.2.1 配置混合模式桥组

注意事项 当配置VLAN透传功能时,需要注意以下事项: 子接口不支持VLAN透传。 F100A设备的四个LAN接口需要执行undo insulate命令聚合成一个接口才能使用VLAN透传功能。 VLAN透传与交换机的Trunk功能并不相同,当与交换机互通时,如果希望SecPath 防火墙与交换机的管理VLAN 互通,需要借助子接口来实现。即将配置了与交换机管理VLAN ID相同的子接口加入到桥组,并创建相应的桥组虚接口(BVI接口),配置同一网段地址,则防火墙的桥组虚接口就可以与交换机管理VLAN接口互通。 3 配置举例 VLAN透传典型应用组网 3.1.1 组网需求 客户端PC,A、C属于VLAN100,客户端PC,B、D属于VLAN200,客户端PC,M 属于VLAN99,用来模拟属于不同VLAN的用户。在交换机1和交换机2与防火墙相连接口上都要配置成Trunk模式,保证带Tag标记的报文能够透传。交换机Switch1和Switch2的管理VLAN为VLAN99。 要求VLAN100和VLAN200能够互相隔离,交换机可以通过管理VLAN99与防火墙互通。 3.1.2 物理连接图

新格林耐特配置命令

第一部分:TiNetS2000EI系列配置命令及说明 (红色标识为一些常用命令) Username(1-32chars):admin Password(1-16chars):******/登陆交换机,默认密码123456/ TiNet>enable/进入特权模式/ TiNet#configureterminal/进入全局模式/ TiNet(config)# 1.T INET#terminallanguage/改变语言模式/ 例如:TINET#terminallanguageChinese/改成中文模式/ #clearstartup-config/清除配置,恢复出厂默设置/ 3.T iNet#copyrunning-configstartup-config/保存配置命令/ 4.T iNet#load application下载应用程序 configuration下载配置文件 keyfile下载SSH密钥文件 whole-bootrom下载全部的bootrom/设备升级命令/ 5.T iNet(config)#ipaddress /配置交换机IP地址/ 6.T iNet(config)show/show命令,后可以打问号/ Showip Showmac Showinterface

Showvlan 7.T iNet(config)#vlan3901/建立VLAN3901/ TiNet(config-if-vlan)#switchportethernet0/1/把端 口1加入该VLAN/ TiNet(config)#ipvlan3901/定义管理vlan为3901 TiNet(config)#noipvlan1/删除默认管理VLAN1/ 8.T iNet(config)#vlan1001-1512/批量建立VLAN/ 9.T iNet(config-if-vlan)#switchportethernet0/2toetherne t0/8ethernet0/11ethernet0/16 /在某一VLAN中或者VLAN段中批量加入端口/ 10.TiNet(config-if-ethernet-0/16)#tagvlan1001,1112-1 512,4000 /端口下批量打tag/ 11.TiNet(config-if-ethernet-0/1)#switchportmodetrunk /改变端口模式,为trunk模式/ 12.TiNet(config-if-ethernet-0/1)#switchporttrunkallo wedvlanall /端口为trunk模式,允许所有VLAN通过/ 13.TiNet(config-if-ethernet-0/2)#switchportaccessvla

神州数码 交换机 Vlan配置命令

VLAN配置命令 8.2.2.1 vlan 命令:vlan [vlan-id] no vlan [vlan-id] 功能:创建vlan 并且进入vlan 配置模式,在vlan 模式中,用户可以配置vlan 名称和为该vlan 分配交换机端口;本命令的no 操作为删除指定的vlan。 参数:[vlan-id]为要创建/删除的vlan 的vid,取值范围为1~4094。 命令模式:全局配置模式 缺省情况:交换机缺省只有vlan1。 使用指南:vlan1 为交换机的缺省vlan,用户不能配置和删除vlan1。允许配置vlan的总共数量为4094 个。另需要提醒的是不能使用本命令删除通过gvrp 学习到的动态vlan。 举例:创建vlan100,并且进入vlan100 的配置模式。 switch (config)#vlan 100 switch (config-vlan100)# 8.2.2.2 name 命令:name [vlan-name] no name 功能:为vlan 指定名称,vlan 的名称是对该vlan 一个描述性字符串;本命令的no 操作为删除vlan 的名称。 参数:[vlan-name]为指定的vlan 名称字符串。 命令模式:vlan 配置模式 缺省情况:vlan 缺省名称为vlanxxx,其中xxx 为vid。 使用指南:交换机提供为不同的vlan 指定名称的功能,有助于用户记忆vlan,方便管理。 举例:为vlan100 指定名称为testvlan。

switch (config-vlan100)#name testvlan 8.2.2.3 switchport access vlan 命令:switchport access vlan [vlan-id] no switchport access vlan 功能:将当前access 端口加入到指定vlan;本命令no 操作为将当前端口从vlan 里删除。 参数:[vlan-id]为当前端口要加入的vlan vid,取值范围为1~4094。 命令模式:接口配置模式 缺省情况:所有端口默认属于vlan1。 使用指南:只有属于access mode 的端口才能加入到指定的vlan 中,并且access 端口同时只能加入到一个vlan 里去。 举例:设置某access 端口加入vlan100。 switch (config)#interface ethernet 0/0/8 switch (config-ethernet0/0/8)#switchport mode access switch (config-ethernet0/0/8)#switchport access vlan 100 switch (config-ethernet0/0/8)#exit 8.2.2.4 switchport interface 命令:switchport interface [interface-list] no switchport interface [interface-list] 功能:给vlan 分配以太网端口的命令;本命令的no 操作为删除指定vlan 内的一个或一组端口。 参数:[interface-list] 要添加或者删除的端口的列表,支持”;””-”,如:ethernet 0/0/1;2;5或ethernet 0/0/ 1-6;8。 命令模式:vlan 配置模式 缺省情况:新建立的vlan 缺省不包含任何端口。 使用指南:access 端口为普通端口,可以加入vlan,但同时只允许加入一个vlan。

交换机配置命令

配置命令 交换机之间用交叉线 1进入特权模式:Switch>enable 2配置模式Switch#config 3配置主机名:Switch(config)#hostname S1 4.设置访问口令S1#configure terminal S1(config)#line console 0 S1(config-line)#password cisco S1(config-line)#login S1(config-line)#line vty 0 15 S1(config-line)#password cisco S1(config-line)#login S1(config-line)#exit 5.将使能加密口令设置为class。 S1(config)#enable secret class S1(config)#配置默认网关 6.在虚拟接口vlan99设置交换机ip地址 S1(config)#interface vlan99 S1(config-if)# S1(config-if)#no shutdown S1(config-if)#exit 7.交换机VLAN 分配端口 S1(config)#interface fa0/1 S1(config-if)#switchport mode access S1(config-if)#switchport access vlan 99 S1(config-if)#exit 8.给vlan命名 S1(config)#vlan 10 S1(config-vlan)#name Faculty/Staff S2.S3.本征vlan即分配端口 s2.s3连接s1 使用中继vlan S1中继vlan S1(config)#interface FastEthernet 0/1 S1(config-if)#switchport mode trunk S1(config-if)#switchport trunk native vlan 99 9..设置交换机默认网关 S1(config)# S1(config)#exit 10..配置快速以太网接口的端口速率和双工设置。 S1#configure terminal S1(config)#interface fastethernet 0/18 S1(config-if)#speed 100 S1(config-if)#duplex full S1(config-if)#end 11.清除mac地址表S1#clear mac-address-table dynamic 12.设置静态MAC 地址。

H3C交换机配置管理vlan命令

H3C交换机配置管理vlan命令 以遵义县公司H3C交换机配置为例,通过console口连接交换机,登录上后进入界面如下图 输入system-view 进入系统配置 输入undo interface vlan-interface 1 及undo management-vlan取消交换机默认管理vlan 1 输入vlan 1000 及description guanli-vlan创建新的vlan,

management-vlan 1000把新建vlan设成管理vlan interface Vlan-interface 1000及ip address 2.2.2.5 24为该vlan分配管理ip地址 各县公司配置ip地址见下图 ip地址配置完成后输入ping 2.2.2.2,测试是否能ping通市公司交换机。如能ping通,界面如下图:

如没有出现如图界面,则需检查数据配置过程是否正确。 为管理ip地址配置登录用户名及密码认证 [Switch]user-interface vty 0 4 [Switch-ui-vty0-4]authentication-mode scheme //表示在进行telnet时要进行本地或远端用户名和密码验证,否则不能登陆 [Switch-ui-vty0-4]quit [Switch]local-user h3c //本地用户名h3c [Switch-luser-h3c]service-type telnet level 3//表示该用户名的服务类型为telnet,权限为3级权限 [Switch-luser-h3c]password simple h3c //表示明文密码为h3c 最后在交换机上telnet自己配好的ip地址2.2.2.X,输入用户名及密码h3c。如能登录上自己的交换机,则数据配置成功;如不能登录,则需仔细检查数据配置过程有无遗漏。

H3C的VLAN原理以及配置

实验二交换机的端口技术与VLAN配置 1.实验目的 a.了解H3C系列交换机的端口工作模式并按照实验步骤熟悉配置。 b.了解VLAN技术的应用原理及在H3C交换机上实现VLAN的划分 2.实验环境 H3C系列交换机的VRP环境 3.实验步骤 (1)端口技术 a.端口类型 大家知道,PC和路由器的以太网接口为MDI,交换机为MDI-X,这样在交换机之间应用交叉线,PC与交换机之间应用直连线,这样在连接时带来 了很多麻烦,所以H3C交换机系列提供了智能转换技术,当然可以用命令 进行配置: [H3C]int E 1/0/1 [H3C-Ethernet1/0/1]mdi {normal|across|auto} 分别对应{MDI-X|MDI|自动} 一般调为自动即可 b.流量控制 [H3C-Ethernet1/0/1]duplex full 端口设置全双工注意对端也要为全双工 [H3C-Ethernet1/0/1]speed 100 端口限速为100Mbps,注意对端一致 [H3C-Ethernet1/0/1]flow-control 打开流量控制的命令 c.端口聚合 在端口的全双工工作模式下,可以采用端口聚合(相当于多个端口合并为一个端口,带宽叠加)技术来传输数据。 实验配置和下面VLAN结合。 (2)VLAN的配置 a.VLAN的产生 由于各交换机处于TCP/IP协议栈的第二层,二层设备中广播报文可以任 意传播,而只有路由器才能隔绝二层上的本地广播报文所以,如果要隔绝 广播报文,提高局域网理由率,只能引入三层设备,大大增加成本,所以 诞生了VLAN技术(虚拟局域网),在逻辑上把网络资源和网络用户按照 一定原则进行划分,形成多个小的逻辑网络,各自有各自的广播域。 b.VLAN的优点 ·减少移动和改变代价 ·虚拟工作组 ·用户不受物理设备限制,VLAN用户可以处于网络中任意地方 ·VLAN对用户应用不产生影响 ·限制广播包,提高带宽利用率 ·增强通讯安全性 ·增强网络健壮性 c.VLAN的划分 ·基于端口的VLAN划分 将端口与VLAN制定映射关系 ·基于MAC的VLAN划分 将MAC地址与VLAN制定映射关系

VLAN基本配置命令及说明

VLAN简介: VLAN(Virtual LAN)可以隔离广播域。VLAN工作在OSI的第2层,VLAN是交换机端口的逻辑组合,可以把在同一交换上的端口组合成一个VLAN,也可以把在不同交换机上的端口组合成一个VLAN,一个VLAN就是一个广播域,VLAN 间的通信如果不通过第三层的路由功能是无法通信的。 说明:VLAN间的通信在特殊情况下不借助第三层的路由功能也可以实现。例如: 1:sw1的F0/1和F0/2都是Access模式,都处于Vlan2;sw2的F0/1和F0/2都是Access模式,都处于Vlan3;PC1和PC2也都均处于同一网段,那么这时PC1就可以ping通PC2。 原因:当接口都为Access时,两台交换机都不涉及打、拆标签工作;只有在Trunk的时候交换机才打、拆标签。 2:sw1的F0/1口接入Vlan2,sw2的F0/1口接入Vlan3;sw1和sw2间配置Trunk模式,指定sw1的Native VLAN 为Vlan 2,sw2的Native VLAN为Vlan3;关闭sw1 Vlan2和sw2上Vlan3的spanning-tree。PC1和PC2也都均处于同一网段,那么这时PC1就可以ping通PC2。 原因:Trunk链路发送Native VLAN的数据时不打标签,Trunk链路收到Native VLAN数据时交付到本地的Native VLAN;另外启用spanning-tree时会阻塞某个端口,需要关闭掉阻塞方的spanning-tree。 二层交换网络的缺点: 极易引起广播碰撞/广播风暴/通信效率低/管理效率低/安全性不高 VLAN的特点: VLAN能够最大限度地控制广播的影响以及减少由于共享介质所造成的安全隐患VLAN允许一组不限物理位置的用户群共享一个独立的广播域一个VLAN中的所有设备都是同一广播域的成员一个VLAN是一个逻辑的子网,共享一个网络地址,且VLAN间的通信必须经过路由器,就像真正的两个网段一样VLAN可以基于端口或MAC地址来划分交换机允许在同一台交换机上可存在多个VLAN,也允许这些VLAN跨越其它交换机 划分VLAN的目的: 1.提高安全性:缩小ARP攻击范围,ARP报文是一个 2.5层的报文,划分VLAN后只能在同一个VLAN中传播 2.提高性能:隔离广播域,缩小广播域的大小缩小了广播报文能达到的范围 VLAN的创建

Vlan知识点及配置命令

Vlan虚拟局域网(附代码) Vlan(Virtual Local Area Network)即虚拟局域网。 虚拟局域网(VLAN)是一组逻辑上的设备和用户,这些设备和用户并不受物理位置的限制,可以根据功能、部门及应用等因素将它们组织起来,相互之间的通信就好像它们在同一个网段中一样,由此得名虚拟局域网。VLAN是一种比较新的技术,工作在OSI参考模型的第2层和第3层,一个VLAN就是一个广播域,VLAN之间的通信是通过第3层的路由器来完成的。与传统的局域网技术相比较,VLAN技术更加灵活,它具有以下优点:网络设备的移动、添加和修改的管理开销减少;可以控制广播活动;可提高网络的安全性。 在计算机网络中,一个二层网络可以被划分为多个不同的广播域,一个广播域对应了一个特定的用户组,默认情况下这些不同的广播域是相互隔离的。不同的广播域之间想要通信,需要通过一个或多个路由器。这样的一个广播域就称为VLAN。 VLAN可以把同一个物理网络划分为多个逻辑网段,因此,Vlan可以抑制网络风暴,增强网络的安全性。 1.vlan 建立: 在全局模式下: vlan database vlan id name renshichu 2.把vlan 对应分给端口: 在配置模式下进入端口:

interface fastEthernet0/1 switch mode access switch access vlan id 3.如果一次把多个端口划分给某个vlan可以使用interface range命 令。 interface range fastEthernet0/1-4 switch mode access switch access vlan id 4.如果一个vlan需要改变id号,直接进入该端口,重新设置即可interface fastEthernet0/1 switch mode access switch access vlan id(新) 5.如果一个一个端口的vlan不在需要了,需要删除,进入该端口, 用no 命令: interface fastEthernet0/1 switch mode access no switch access vlan id(需要删除的id号) 6.查看vlan信息,在全局模式下: show vlan show vlan brief show vlan id 30 show vlan name renshichu

校园网VLAN设计与配置

长沙理工大学城南学院 《计算机网络》课程设计报告 张鹏 学院城南学院专业通信工程 班级通信1001班学号133 学生姓名张鹏指导教师王静 课程成绩完成日期2013年7月5日 课程设计成绩评定 学院城南学院专业通信工程 班级通信1001班学号133 学生姓名张鹏指导教师王静 完成日期2013年7月5日 指导教师对学生在课程设计中的评价 评分项目优良中及格不及格课程设计中的创造性成果 学生掌握课程内容的程度 课程设计完成情况 课程设计动手能力 文字表达 学习态度 规范要求 课程设计论文的质量 指导教师对课程设计的评定意见 综合成绩指导教师签字2013年7月8日

课程设计任务书 城南学院通信工程专业

校园网VLAN设计与配置 学生姓名:张鹏指导老师:王静 摘要目前校园网正处于一种高速发展之中,在校园网络中实施VLAN技术,可以提高网络管理效率、性能、带宽及灵活性, 同时还能控制广播风暴, 提高校园网安全性能。在本次课程设计中,结合高校校园网的特点,主要基于VLAN技术,从IP规划、网络架构设计、协议选择、网络设备配置等方面对校园网进行了规划和设计,以此来提高系统的运作性能, 起到均衡网络数据流量, 合理利用网络资源的作用,进而建设稳定性好、管理性强、安全性高的校园网络。 关键词校园网;VLAN;三层交换机;二层交换机 目录 1 引言 (1) 1.1 课程设计的目的 (1) 1.2 课程设计的要求 (1) 1.3 课程设计的平台 (2) 1.4 课程设计的步骤 (2) 2 设计原理 (2) 2.1 VLAN技术的定义和特征 (2) 2.2 VLAN在网络管理中的优势 (3) 2.3 TRUNK链路技术 (4) 2.4 VLAN的划分方法 (5) 2.5 VLAN之间的通信 (6) 3 VLAN技术在校园网中的设计 (7) 3.1 网络设备的选择 (7) 3.2 校园网络的设计 (8) 3.3 校园网IP的划分 (8) 3.4 VLAN在网络中的划分 (8) 3.5 VLAN技术在校园网中的测试 (10) 4 分析总结 (11)

华为交换机配置命令

华为交换机配置指令 视图切换指令 system-view [Quidway]quit//用可以从任意视图直接回到用户视图 交换机命名 [Quidway]sysname devicename 配置文件的保存与删除 保存配置:save 擦除配置:reset saved-configuration reboot 交换机端口基本配置 进入相应端口的视图:[Quidway]interface interface-type interface-number 打开以太网端口:[Switch-ethernet port-id]undo shutdown 设置以太网端口描述字符串:[Switch-ethernet port-id]description text 设置以太网端口的双工模式:[Switch-ethernet port-id]duplex { auto | full | half } 设置以太网端口的速率:[Switch-ethernet port-id]speed { 10 | 100 | 1000 | auto } 设置以太网端口的MDI模式:[Switch-ethernet port-id]mdi { across | auto | normal } 开启以太网端口的流量控制功能:[Switch-ethernet port-id]flow-control display查看指令 查看版本信息:display version 查看当前配置:display current-configuration 查看保存配置:display saved-configuration 显示接口信息:display interface 显示接口IP状态与配置信息:display ip interface brief 显示系统运行统计信息:display diagnostic-information

关于LAN网内VLAN与Trunk的详细配置

关于LAN网内VLAN与Trunk的详细配置 此实验过程是在Boson NetSim for CCNP version 6.0 BETA 1软件下做的。其中使用2台C2905switch和4台PC机。 实验内容: 1、配置控制端口和虚拟线路 2、设置VLAN两个,分别为:VLAN100 Pcontrol和VLAN200 Accout 3、分别将接口加入到VLAN100和VLAN200后配置Trunk线路,保证VLAN间的通信 4、最后进行测试是否成功 关于LAN网内VLAN与Trunk的详细配置 SW1(C2950)交换机测试详细步骤及结果: CLI session with the switch is open. To end the CLI session, enter [Exit]. Switch> %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/4, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/4, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/5, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/5, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/6, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/6, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/7, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/7, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/8, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/8, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/9, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/9, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/11, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/11, changed state to down %LINK-3-UPDOWN: Interface FastEthernet0/12, changed state to down

华为常见VLAN命令

# 进入系统视图。 system-view [Quidway] # 退出。 [Quidway] quit # 显示配置信息。 [Quidway] display current-configuration # 创建VLAN2、VLAN3、VLAN4。 system-view [Quidway] vlan 2 3 4 [Quidway-vlan2] quit # 将接口GigabitEthernet0/0/1的类型为Trunk,并加入到VLAN2 中。[Quidway] interface gigabitethernet 0/0/1 [Quidway-GigabitEthernet0/0/1] port link-type trunk [Quidway-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 [Quidway-GigabitEthernet0/0/1] quit # 在S-switch上配置接口GE0/0/1为Hybrid 类型,并加入VLAN100、VLAN200、VLAN300。 [S-switch] interface GigabitEthernet 0/0/1 [S-switch-GigabitEthernet0/0/1] port link-type hybrid [S-switch-GigabitEthernet0/0/1] port hybrid untagged vlan 100 200 300 [S-switch-GigabitEthernet0/0/1] quit # 在S-switch上配置接口GE0/0/3加入VLAN100、VLAN200、VLAN300。 [S-switch] interface GigabitEthernet 0/0/3 [S-switch-GigabitEthernet0/0/3] port trunk allow-pass vlan 100 200 300 [S-switch-GigabitEthernet0/0/3] quit # 在S-switch上使能接口GE0/0/1的IP 子网VLAN 功能。 [S-switch] interface GigabitEthernet 0/0/1 [S-switch-GigabitEthernet0/0/1] ip-subnet-vlan enable [S-switch-GigabitEthernet0/0/1] quit # 在S-switch上配置VLAN100 与IP 地址192.168.1.2关联,优先级为2。 [S-switch] vlan 100 [S-switch-vlan100] ip-subnet-vlan ip 192.168.1.2 24 priority 2 [S-switch-vlan100] quit

相关主题
文本预览
相关文档 最新文档