我的设置:
我从我的 ISP 收到一个/24公共 IP 子网(例如:)20.20.20.0/24。
我们的一些部门想要完全控制他们的公共 IP,所以我把它分成了几个/27子网。
一开始我想设置 3 个 VLAN:
- VLAN 100:
20.20.20.32/27 - VLAN 200:
20.20.20.128/27 - VLAN 5(WAN 连接):
20.20.20.0/30
交换机的网关是20.20.20.1。
我在 SG300-28 上配置了一条静态路由(处于 L3 模式):
0.0.0.0/0超过20.20.20.1
VLAN 100 或 VLAN 200 中的客户端无法访问 ISP 网关或互联网。
如果我将客户端放在 VLAN 5 中,他当然可以连接到 GW 和互联网。
我是盲目地看到错误,所以我指望你们。
Cisco Packet Tracer 示例:PKT 文件
配置:
config-file-header
switche5bce7
v1.4.5.02 / R800_NIK_1_4_194_194
CLI v1.0
set system mode router
file SSD indicator encrypted
@
ssd-control-start
ssd config
ssd file passphrase control unrestricted
no ssd file integrity control
ssd-control-end cb0a3fdb1f3a1af4e4430033719968c0
!
vlan database
vlan 5,10,100,200
exit
voice vlan oui-table add 0001e3 Siemens_AG_phone________
voice vlan oui-table add 00036b Cisco_phone_____________
voice vlan oui-table add 00096e Avaya___________________
voice vlan oui-table add 000fe2 H3C_Aolynk______________
voice vlan oui-table add 0060b9 Philips_and_NEC_AG_phone
voice vlan oui-table add 00d01e Pingtel_phone___________
voice vlan oui-table add 00e075 Polycom/Veritel_phone___
voice vlan oui-table add 00e0bb 3Com_phone______________
ip dhcp server
ip dhcp pool network Pool_5
address low 20.20.20.6 high 20.20.20.10 255.255.255.224
default-router 20.20.20.5
dns-server 8.8.8.8
exit
ip dhcp pool network Pool_100
address low 20.20.20.34 high 20.20.20.62 255.255.255.224
default-router 20.20.20.33
dns-server 8.8.8.8
exit
ip dhcp pool network Pool_200
address low 20.20.20.130 high 20.20.20.158 255.255.255.224
default-router 20.20.20.129
dns-server 8.8.8.8
exit
bonjour interface range vlan 1
ip access-list extended VLAN_100-IN
permit ip any any ace-priority 1
exit
ip access-list extended VLAN_1-IN
permit ip any any ace-priority 1
exit
hostname switche5bce7
line console
no autobaud
exit
no passwords complexity enable
username cisco password encrypted d033e22ae348aeb5660fc2140aec35850c4da997 privilege 15
ip ssh server
ip ssh-client server authentication
ip telnet server
!
interface vlan 1
no ip address dhcp
service-acl input VLAN_1-IN default-action permit-any
!
interface vlan 5
name WAN
!
interface vlan 10
name MGMT
ip address 10.10.10.10 255.255.255.0
!
interface vlan 100
name VLAN_100
ip address 20.20.20.33 255.255.255.224
service-acl input VLAN_100-IN default-action permit-any
!
interface vlan 200
name VLAN_200
ip address 20.20.20.129 255.255.255.224
!
interface gigabitethernet1
ip address 20.20.20.2 255.255.255.252
!
interface gigabitethernet2
switchport mode access
switchport access vlan 5
!
interface gigabitethernet3
switchport mode access
!
interface gigabitethernet4
switchport mode access
!
interface gigabitethernet5
switchport mode access
!
interface gigabitethernet10
service-acl input VLAN_100-IN
switchport mode access
switchport access vlan 100
!
interface gigabitethernet20
switchport mode access
switchport access vlan 200
!
interface gigabitethernet25
switchport mode access
switchport access vlan 10
!
interface gigabitethernet26
switchport mode access
switchport access vlan 10
!
exit
ip default-gateway 20.20.20.1