单臂路由和静态路由的配置
配置命令
SW1
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface Ethernet0/0/2
port link-type access
port default vlan 10
#
interface Ethernet0/0/3
port link-type access
port default vlan 20
R1
interface GigabitEthernet0/0/0
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/0.10
dot1q termination vid 10
arp broadcast enable
#
interface GigabitEthernet0/0/0.20
dot1q termination vid 20
arp broadcast enable
#
interface GigabitEthernet0/0/1.10
dot1q termination vid 10
ip address 192.168.10.254 255.255.255.0
arp broadcast enable
#
interface GigabitEthernet0/0/1.20
dot1q termination vid 20
ip address 192.168.20.254 255.255.255.0
arp broadcast enable
#
ip route-static 192.168.30.0 255.255.255.0 10.1.1.2
ip route-static 192.168.40.0 255.255.255.0 10.1.1.2
SW2
interface Vlanif30
ip address 192.168.30.254 255.255.255.0
#
interface Vlanif40
ip address 192.168.40.254 255.255.255.0
#
interface Vlanif50
ip address 10.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 50
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 40
#
ip route-static 0.0.0.0 0.0.0.0 10.1.1.1
实验结果