将 D-LINK DSL 225 连接到多层交换机

将 D-LINK DSL 225 连接到多层交换机

我想将家用路由器 D-link DSL 225 连接到多层交换机,这样连接到交换机的计算机就可以访问互联网。

路由器ip(DG)是10.0.0.138。

路由器连接交换机到Gi0/3,我把交换机的端口ip配置为10.0.0.137。

我将 vlan 10 配置为 IP 地址 192.168.10.1,并且在 Gi0/0 中有一台计算机连接到它,计算机 ip 是 192.168.10.10。

我成功 ping 通了从交换机 CLI我甚至设法 ping 路由器IP 8.8.8.8。

我唯一遇到的问题就是从计算机 ping 到路由器 IP(10.0.0.138)以及 8.8.8.8。

我只能从计算机 ping 到 10.0.0.137 (端口 Gi0/3)

路由器处于默认设置(我重置了它),我只更改了 DG IP。

有人帮助我并告诉我在路由器中添加静态路由,但他没有给我提供这样做的说明。

所以我在路由器中添加了静态路由:

IP Version: IPv4

Destination IP/prefix length: 192.168.10.10/32

Interface: LAN/br0

Gateway:10.0.0.138

所以现在我可以从计算机 ping 到 10.0.0.138 但仍然无法到达 8.8.8.8。

我只想问一下是否可以这样做,还是我在浪费时间?或者我需要在路由器上配置一些东西?

我的网络(d-link 型号是 dsl 225 而不是 615):
在此处输入图片描述

我的交换机配置:

spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
vlan 10
 name comp
!
vlan 100
 name VLAN100
!
vlan 200,300
!
!
!
!
!
!
!
!
!
!
!
!
!
interface GigabitEthernet0/0
 switchport access vlan 10
 media-type rj45
 negotiation auto
!
interface GigabitEthernet0/1
 media-type rj45
 negotiation auto
!
interface GigabitEthernet0/2
 media-type rj45
 negotiation auto
!
interface GigabitEthernet0/3
 no switchport
 ip address 10.0.0.137 255.255.255.0
 negotiation auto
!
interface Vlan10
 ip address 192.168.10.1 255.255.255.0
!
ip forward-protocol nd
!
no ip http server
no ip http secure-server
!
ip route 0.0.0.0 0.0.0.0 10.0.0.138
!
!
!

答案1

路由器需要到 192.168.10.0/24 网络的路由。您需要在路由器上设置静态路由,将 192.168.10.0/24 指向 10.0.0.137 作为网关。

如果没有该静态路由,路由器尝试发送到远程 VLAN 的任何数据包都将使用默认路由发送到 Internet。

相关内容