基本配置
Router配置
[R]
[R]int g0/0/0
[R-GigabitEthernet0/0/0]ip ad 192.168.100.1 24
[R-GigabitEthernet0/0/0]q
[R]int g0/0/1
[R-GigabitEthernet0/0/1]ip ad 200.200.200.254 24
[R-GigabitEthernet0/0/1]q
[R]ip route-static 0.0.0.0 0.0.0.0 192.168.100.2
L3 Switch配置
[L3]vlan ba
[L3]vlan batch 10 20 30 40 100
Info: This operation may take a few seconds. Please wait for a moment...done.
[L3]int V 10
[L3-Vlanif10]ip add 192.168.10.254 24
[L3-Vlanif10]int V 20
[L3-Vlanif20]ip add 192.168.20.254 24
[L3-Vlanif20]int V 30
[L3-Vlanif30]ip add 192.168.30.254 24
[L3-Vlanif30]int V 40
[L3-Vlanif40]ip add 192.168.40.254 24
[L3-Vlanif40]int V 100
[L3-Vlanif100]ip add 192.168.100.2 24
[L3-Vlanif100]q
[L3]int g0/0/1
[L3-GigabitEthernet0/0/1]port li acc
[L3-GigabitEthernet0/0/1]port def vlan 10
[L3-GigabitEthernet0/0/1]int g0/0/2
[L3-GigabitEthernet0/0/2]port li acc
[L3-GigabitEthernet0/0/2]port de vlan 20
[L3-GigabitEthernet0/0/2]int g0/0/3
[L3-GigabitEthernet0/0/3]port li acc
[L3-GigabitEthernet0/0/3]port de vlan 30
[L3-GigabitEthernet0/0/3]q
[L3]int g0/0/24
[L3-GigabitEthernet0/0/24]port li acc
[L3-GigabitEthernet0/0/24]port de vlan 100
[L3-GigabitEthernet0/0/24]q
[L3]ip rout 0.0.0.0 0.0.0.0 192.168.100.1
检查配置结果
R
[R]dis cur
[V200R003C00]
#
sysname R
interface GigabitEthernet0/0/0
ip address 192.168.100.1 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 200.200.200.254 255.255.255.0
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 192.168.100.2
#
user-interface con 0
authentication-mode password
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
L3
[L3]dis cur
#
sysname L3
#
vlan batch 10 20 30 40 100
interface Vlanif1
#
interface Vlanif10
ip address 192.168.10.254 255.255.255.0
#
interface Vlanif20
ip addre