?第一步
?
交换机上先创建VLAN
[sw1]vlan batch 2 to 10
[sw1]display? vlan 查看vlan
然后交换机上各个接口划分到对应的VLAN中
[sw1]interface Eth0/0/1
[sw1-Ethernet0/0/1]port link-type access??
[sw1-Ethernet0/0/1]port default vlan 2? ?
如图为sw1:
[sw1]port-group group-member Ethernet 0/0/1 to eth
[sw1]port-group group-member Ethernet 0/0/1 to Ethernet 0/0/2
[sw1-port-group]por
Dec 22 2021 21:58:35-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/1]por
Error: The interface is already a L2 interface.
[sw1-Ethernet0/0/2]por
Error: The interface is already a L2 interface.
[sw1-port-group]
[sw1-port-group]
[sw1-port-group]port link
[sw1-port-group]port link-
[sw1-port-group]port link-flap
[sw1-port-group]port link-type
[sw1-port-group]port link-flap
[sw1-port-group]port link-type acc
[sw1-port-group]port link-type access
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/2]port link-type access
[sw1-port-group]
Dec 22 2021 21:58:55-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-port-group]
[sw1-port-group]
[sw1-port-group]por
[sw1-port-group]port
[sw1-port-group]portswitch
[sw1-port-group]port-auto-sleep
[sw1-port-group]port-security
[sw1-port-group]port-isolate
[sw1-port-group]port-mirroring
[sw1-port-group]port de
[sw1-port-group]port default vlan2
^
Error: Unrecognized command found at '^' position.
[sw1-port-group]port default vlan 2
[sw1-Ethernet0/0/1]port default vlan 2
[sw1-Ethernet0/0/2]port default vlan 2
[sw1-port-group]
[sw1-port-group]
[sw1-port-group]
Dec 22 2021 21:59:25-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 11, the
change loop count is 0, and the maximum number of records is 4095.
[sw1-port-group]
[sw1-port-group]
[sw1-port-group]
[sw1-port-group]
[sw1-port-group]
[sw1-port-group]
[sw1-port-group]
[sw1-port-group]
[sw1-port-group]q
[sw1]port
[sw1]portswitch
[sw1]portal
[sw1]port-isolate
[sw1]port-mirroring
[sw1]port-group grou
[sw1]port-group group-member eth
[sw1]port-group group-member Ethernet 0/0/3 to eth
[sw1]port-group group-member Ethernet 0/0/3 to Ethernet 0/0/4
[sw1-port-group]
Dec 22 2021 22:00:25-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 12, the
change loop count is 0, and the maximum number of records is 4095.port
^
Error:Incomplete command found at '^' position.
[sw1-port-group]
[sw1-port-group]
[sw1-port-group]port link
[sw1-port-group]port link-
[sw1-port-group]port link-flap
[sw1-port-group]port link-type acc
[sw1-port-group]port link-type access
[sw1-Ethernet0/0/3]port link-type access
[sw1-Ethernet0/0/4]port link-type access
[sw1-port-group]por
[sw1-port-group]port de
[sw1-port-group]port default
Dec 22 2021 22:00:45-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 14, the
change loop count is 0, and the maximum number of records is 4095.
^
Error:Incomplete command found at '^' position.
[sw1-port-group]port default vlan 3
[sw1-Ethernet0/0/3]port default vlan 3
[sw1-Ethernet0/0/4]port default vlan 3
[sw1-port-group]
Dec 22 2021 22:00:55-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 16, the
change loop count is 0, and the maximum number of records is 4095.
如图为sw2:
[sw2]int Eth 0/0/1
[sw2-Ethernet0/0/1]port lin
[sw2-Ethernet0/0/1]port link-
[sw2-Ethernet0/0/1]port link-flap
[sw2-Ethernet0/0/1]port link-type acc
[sw2-Ethernet0/0/1]port link-type access
[sw2-Ethernet0/0/1]port link-type access
[sw2-Ethernet0/0/1]port de
[sw2-Ethernet0/0/1]port default
Dec 22 2021 22:02:00-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.vl
^
Error:Incomplete command found at '^' position.
[sw2-Ethernet0/0/1]
[sw2-Ethernet0/0/1]port default vlan 2
[sw2-Ethernet0/0/1]
Dec 22 2021 22:02:10-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 8, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw2-Ethernet0/0/1]
[sw2-Ethernet0/0/1]
[sw2-Ethernet0/0/1]
[sw2-Ethernet0/0/1]q
[sw2]int eth
[sw2]int Ethernet 0/0/1
[sw2-Ethernet0/0/1]q
[sw2]int
[sw2]interface et
[sw2]interface Eth 0/0/2
[sw2-Ethernet0/0/2]port
[sw2-Ethernet0/0/2]port lin
[sw2-Ethernet0/0/2]port link-
[sw2-Ethernet0/0/2]port link-flap
[sw2-Ethernet0/0/2]port link-type acc
[sw2-Ethernet0/0/2]port link-type access
[sw2-Ethernet0/0/2]port de
[sw2-Ethernet0/0/2]port default vl
[sw2-Ethernet0/0/2]port default vlan 3
[sw2-Ethernet0/0/2]
Dec 22 2021 22:02:51-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 10, the
change loop count is 0, and the maximum number of records is 4095.
[sw2-Ethernet0/0/2]
[sw2-Ethernet0/0/2]
[sw2-Ethernet0/0/2]
第二步
trunk干道需要VLAN2和VLAN3之间流量互通? 不然传不过去
与路由器之间也要trunk干道
[sw1]interface eth
[sw1]interface Eth 0/0/6
[sw1-Ethernet0/0/6]por
[sw1-Ethernet0/0/6]port link
[sw1-Ethernet0/0/6]port link-
[sw1-Ethernet0/0/6]port link-flap
[sw1-Ethernet0/0/6]port link-type trunk
[sw1-Ethernet0/0/6]
Dec 22 2021 22:08:05-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 17, the
change loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/6]
[sw1-Ethernet0/0/6]po
[sw1-Ethernet0/0/6]port tr
[sw1-Ethernet0/0/6]port trunk all
[sw1-Ethernet0/0/6]port trunk allow-pass vlan 2 to 3
[sw1-Ethernet0/0/6]
Dec 22 2021 22:08:25-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 18, the
change loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/6]
[sw1-Ethernet0/0/6]q
[sw1]int
[sw1]interface eth
[sw1]interface Eth0/0/5
[sw1-Ethernet0/0/5]por
[sw1-Ethernet0/0/5]port link
[sw1-Ethernet0/0/5]port link-
[sw1-Ethernet0/0/5]port link-flap
[sw1-Ethernet0/0/5]port link-type tr
[sw1-Ethernet0/0/5]port link-type trunk
[sw1-Ethernet0/0/5]por
[sw1-Ethernet0/0/5]port
Dec 22 2021 22:09:05-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 19, the
change loop count is 0, and the maximum number of records is 4095.
^
Error:Incomplete command found at '^' position.
[sw1-Ethernet0/0/5]
[sw1-Ethernet0/0/5]por
[sw1-Ethernet0/0/5]port t
[sw1-Ethernet0/0/5]port trunk all
[sw1-Ethernet0/0/5]port trunk allow-pass vlan 2 to 3
[sw1-Ethernet0/0/5]
Dec 22 2021 22:09:15-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 20, the
change loop count is 0, and the maximum number of records is 4095.
第三步
单臂路由--路由器子接口:
route]interface g0/0/0.1
[route-GigabitEthernet0/0/0.1]dot
[route-GigabitEthernet0/0/0.1]dot1q ter
[route-GigabitEthernet0/0/0.1]dot1q termination v
[route-GigabitEthernet0/0/0.1]dot1q termination vid
^
Error:Incomplete command found at '^' position.
[route-GigabitEthernet0/0/0.1]dot1q termination vid 2
[route-GigabitEthernet0/0/0.1]ip add 192.168.1.254 24
Dec 22 2021 22:20:24-08:00 route %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0.1 has entered the UP state.
[route-GigabitEthernet0/0/0.1]
[route-GigabitEthernet0/0/0.1]
[route-GigabitEthernet0/0/0.1]
[route-GigabitEthernet0/0/0.1]a
[route-GigabitEthernet0/0/0.1]arp br
[route-GigabitEthernet0/0/0.1]arp broadcast en
[route-GigabitEthernet0/0/0.1]arp broadcast enable
[route-GigabitEthernet0/0/0.1]
[route-GigabitEthernet0/0/0.1]q
[route]int
[route]interface g
[route]interface GigabitEthernet 0/0/0.2
[route-GigabitEthernet0/0/0.2]
[route-GigabitEthernet0/0/0.2]
[route-GigabitEthernet0/0/0.2]dot
[route-GigabitEthernet0/0/0.2]dot1q te
[route-GigabitEthernet0/0/0.2]dot1q termination v
[route-GigabitEthernet0/0/0.2]dot1q termination vid 3
[route-GigabitEthernet0/0/0.2]
[route-GigabitEthernet0/0/0.2]ip add 192.168.2.254 24
Dec 22 2021 22:21:15-08:00 route %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
IP on the interface GigabitEthernet0/0/0.2 has entered the UP state.
[route-GigabitEthernet0/0/0.2]
[route-GigabitEthernet0/0/0.2]ar
[route-GigabitEthernet0/0/0.2]arp b
[route-GigabitEthernet0/0/0.2]arp broadcast en
[route-GigabitEthernet0/0/0.2]arp broadcast enable
[route-GigabitEthernet0/0/0.2]
dhcp如下:
[route]ip pool a
Info: It's successful to create an IP address pool.
[route-ip-pool-a]
[route-ip-pool-a]
[route-ip-pool-a]network
[route-ip-pool-a]network 192.168.1.0 ma
[route-ip-pool-a]network 192.168.1.0 mask 255.255.255.0
[route-ip-pool-a]
[route-ip-pool-a]gat
[route-ip-pool-a]gateway-list 192.168.1.1
[route-ip-pool-a]dns
[route-ip-pool-a]dns-list 192.168.2.20 114.114.114.114
[route-ip-pool-a]q
[route]ip poo
[route]ip pool b
Info: It's successful to create an IP address pool.
[route-ip-pool-b]net
[route-ip-pool-b]netbios-type
[route-ip-pool-b]network 192.168.2.0 m 24
[route-ip-pool-b]gat
[route-ip-pool-b]gateway-list 192.168.2.254
[route-ip-pool-b]dns
^
Error:Incomplete command found at '^' position.
[route-ip-pool-b]dns
[route-ip-pool-b]dns-list 114.114.114.114
[route-ip-pool-b]q
[route]ip po
[route]ip policy-based-route
[route]ip pool a
[route-ip-pool-a]undo dns
[route-ip-pool-a]undo dns-list 192.168.2.20 114.114.114.114
^
Error:Too many parameters found at '^' position.
[route-ip-pool-a]undo dns
[route-ip-pool-a]undo dns-list
^
Error:Incomplete command found at '^' position.
[route-ip-pool-a]undo dns
[route-ip-pool-a]undo dns-list 192.168.2.20
[route-ip-pool-a]
[route-ip-pool-a]q
[route]int g0/0/0.0
^
Error: Wrong parameter found at '^' position.
[route]int g0/0/0.1
[route-GigabitEthernet0/0/0.1]dhc
[route-GigabitEthernet0/0/0.1]dhcp se
[route-GigabitEthernet0/0/0.1]dhcp select g
[route-GigabitEthernet0/0/0.1]dhcp select global
[route-GigabitEthernet0/0/0.1]q
[route]int g0/0/0.2
[route-GigabitEthernet0/0/0.2]dhc
[route-GigabitEthernet0/0/0.2]dhcp se
[route-GigabitEthernet0/0/0.2]dhcp select gl
[route-GigabitEthernet0/0/0.2]dhcp select global
结果如图:
PC>ping 192.168.2.253
Ping 192.168.2.253: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.253: bytes=32 seq=2 ttl=127 time=63 ms
From 192.168.2.253: bytes=32 seq=3 ttl=127 time=78 ms
From 192.168.2.253: bytes=32 seq=4 ttl=127 time=78 ms
From 192.168.2.253: bytes=32 seq=5 ttl=127 time=63 ms
--- 192.168.2.253 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/70/78 ms
PC>ping 192.168.2.252
Ping 192.168.2.252: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.252: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.2.252: bytes=32 seq=3 ttl=127 time=63 ms
From 192.168.2.252: bytes=32 seq=4 ttl=127 time=78 ms
From 192.168.2.252: bytes=32 seq=5 ttl=127 time=63 ms
--- 192.168.2.252 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/70/78 ms
|