首先你的核心和路由器之间需要有互联地址,我假设交换机上的互联地址为:192.168.10.1/24,路由器上的互联地址为192.168.10.2/24,那么
交换机配置:
int fa 0/2
no switchport
ip address 192.168.10.1 255.255.255.0
router ospf 1
network 192.168.0.0 0.0.0.255 area 0
network 192.168.10.0 0.0.0.255 area 0
路由器配置:
int fa0/0
ip add 192.168.10.2 255.255.255.0
router ospf 1
network 192.168.2.0 0.0.0.255 area 0
network 192.168.10.0 0.0.0.255 area 0