划分了vlan,开启了dhcp,G1口和G7口接的电脑,24口接的路由器,现在vlan下的电脑都能访问外网,电脑能ping通vlan的网关,但ping不通下面分配的IP,看网上的教程说开启 ip routing 还是不行
no aaa new-model
switch 1provision ws-c3750g-24t
system mturouting 1500
ip subnet-zero
ip routing
!
ip dhcp poolvlan2
network 192.168.2.0 255.255.255.0
default-router 192.168.2.254
dns-server 192.168.1.1
!
ip dhcp poolvlan4
network 192.168.4.0 255.255.255.0
default-router 192.168.4.254
dns-server 192.168.1.1
!
!no file verifyauto
spanning-treemode pvst
spanning-treeextend system-id
!
vlan internalallocation policy ascending
!
interfaceGigabitEthernet1/0/1
switchport access vlan 2
switchport mode access
!
interfaceGigabitEthernet1/0/7
switchport access vlan 4
switchport mode access
!
interfaceGigabitEthernet1/0/24
no switchport
ip address 192.168.1.2 255.255.255.0
!
interface Vlan1
no ip address
!
interface Vlan2
ip address 192.168.2.254 255.255.255.0
!
interface Vlan4
ip address 192.168.4.254 255.255.255.0
!
ip classless
ip route 0.0.0.00.0.0.0 192.168.1.1
ip http server
!
!
control-plane