[SW1]port-group group-member g 0/0/1 g0/0/2
[SW1-port-group]port link-type access
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-port-group]q #这里我是忘记创建vlan了
[SW1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]port-group group-member g 0/0/1 g0/0/2
[SW1-port-group]port default vlan 10
[SW1-GigabitEthernet0/0/1]port default vlan 10
[SW1-GigabitEthernet0/0/2]port default vlan 10
[SW1-port-group]q
[SW1]int g 0/0/3
[SW1-GigabitEthernet0/0/3]p l a
[SW1-GigabitEthernet0/0/3]p d v 10
SW2配置:
[SW2]vlan bat 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2]port-group group-member g 0/0/1 g0/0/2
[SW2-port-group]port link-type access
[SW2-GigabitEthernet0/0/1]port link-type access
[SW2-GigabitEthernet0/0/2]port link-type access
[SW2-port-group]port default vlan 20
[SW2-GigabitEthernet0/0/1]port default vlan 20
[SW2-GigabitEthernet0/0/2]port default vlan 20
[SW2-port-group]int g 0/0/3
^
Error: Unrecognized command found at '^' position. #这里验证从临时组视图无法进入接口视图
[SW2-port-group]q
[SW2]int g 0/0/3
[SW2-GigabitEthernet0/0/3]port link-type access
[SW2-GigabitEthernet0/0/3]port default vlan 20
3.路由器配置
R1-DHCP配置:
[R1-DHCP]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R1-DHCP]ip pool glo1
Info: It's successful to create an IP address pool.
[R1-DHCP-ip-pool-glo1]network 192.168.10.0 mask 24
[R1-DHCP-ip-pool-glo1]dns 1.1.11.1
[R1-DHCP-ip-pool-glo1]gate 192.168.10.254
[R1-DHCP-ip-pool-glo1]q
[R1-DHCP]int g 0/0/2
[R1-DHCP-GigabitEthernet0/0/2]ip add 192.168.10.254 24
[R1-DHCP-GigabitEthernet0/0/2]dhcp select global
[R1-DHCP-GigabitEthernet0/0/2]q
[R1-DHCP]ip route-static 192.168.4.0 24 192.168.3.2 #等价路由
[R1-DHCP]ip route-static 192.168.4.0 24 192.168.2.2
[R1-DHCP]int g0/0/1
[R1-DHCP-GigabitEthernet0/0/1]ip add 192.168.3.1 24
[R1-DHCP-GigabitEthernet0/0/1]int g 0/0/0
[R1-DHCP-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[R1-DHCP]int g 0/0/0
[R1-DHCP-GigabitEthernet0/0/0]dhcp select global
[R1-DHCP-GigabitEthernet0/0/0]int g 0/0/1
[R1-DHCP-GigabitEthernet0/0/1]dhcp select global
[R1-DHCP-GigabitEthernet0/0/1]q
[R1-DHCP]ip pool glo2
Info: It's successful to create an IP address pool.
[R1-DHCP-ip-pool-glo2]net 192.168.4.0 mask 24
[R1-DHCP-ip-pool-glo2]gate 192.168.4.254