我被困在那个交换机不能平路由器和路由器不能平开关。怎么解决这个问题?
我试了那么多变体,但它们帮不了我
实际上,路由器必须做静态路由,这是我想做的,但这对我没有帮助。
我知道有些配置在这里是很糟糕的,实际上在连接的开关上,但是我正在学习。图片

interface FastEthernet0/1
switchport access vlan 12
switchport trunk allowed vlan 2-11
switchport trunk encapsulation dot1q
switchport mode trunk
switchport nonegotiate
!
interface FastEthernet0/2
switchport access vlan 2
switchport mode access
switchport nonegotiate
!
interface FastEthernet0/3
switchport access vlan 3
switchport mode access
switchport nonegotiate
!
interface FastEthernet0/4
switchport access vlan 4
switchport mode access
switchport nonegotiate
!
interface FastEthernet0/5
switchport access vlan 5
switchport mode access
switchport nonegotiate
!
interface FastEthernet0/6
switchport access vlan 6
switchport mode access
switchport nonegotiate
!
interface FastEthernet0/7
switchport access vlan 7
switchport mode access
switchport nonegotiate
!
interface FastEthernet0/8
switchport access vlan 8
switchport mode access
switchport nonegotiate
!
interface FastEthernet0/9
switchport access vlan 9
switchport mode access
switchport nonegotiate
!
interface FastEthernet0/10
switchport access vlan 10
switchport mode access
switchport nonegotiate
!
interface FastEthernet0/11
switchport access vlan 11
switchport mode access
switchport nonegotiate
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan2
mac-address 000a.41cd.4e01
ip address 192.168.0.1 255.255.255.248
!
interface Vlan3
mac-address 000a.41cd.4e02
ip address 192.168.0.9 255.255.255.248
!
interface Vlan4
mac-address 000a.41cd.4e03
ip address 192.168.0.17 255.255.255.248
!
interface Vlan5
mac-address 000a.41cd.4e04
ip address 192.168.0.25 255.255.255.248
!
interface Vlan6
mac-address 000a.41cd.4e05
ip address 192.168.0.33 255.255.255.248
!
interface Vlan7
mac-address 000a.41cd.4e06
ip address 192.168.0.41 255.255.255.248
!
interface Vlan8
mac-address 000a.41cd.4e07
ip address 192.168.0.49 255.255.255.248
!
interface Vlan9
mac-address 000a.41cd.4e08
ip address 192.168.0.57 255.255.255.248
!
interface Vlan10
mac-address 000a.41cd.4e09
ip address 192.168.0.65 255.255.255.248
!
interface Vlan11
mac-address 000a.41cd.4e0a
ip address 192.168.0.73 255.255.255.248
!
interface Vlan12
mac-address 000a.41cd.4e0b
ip address 192.168.0.82 255.255.255.248
!
router rip
!
ip classless
ip route 192.168.0.0 255.255.255.0 192.168.0.0 interface GigabitEthernet0/0
no ip address
duplex auto
speed auto
shutdown
!
interface GigabitEthernet0/1
ip address 196.168.0.81 255.255.255.248
duplex auto
speed auto
!
interface GigabitEthernet0/2
no ip address
duplex auto
speed auto
shutdown
!
interface Vlan1
no ip address
shutdown
!
router rip
!
ip classless Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
Gateway of last resort is not set
196.168.0.0/24 is variably subnetted, 2 subnets, 2 masks
C 196.168.0.80/29 is directly connected, GigabitEthernet0/1
L 196.168.0.81/32 is directly connected, GigabitEthernet0/1发布于 2019-06-12 10:16:41
我想你想把交换机接口FastEthernet0 0/1连接到路由器接口GigabitEthernet0 0/1,对吗?
如果要将流量从vlan 2-11路由到路由器,则必须:
接口FastEthernet0 0/1 ip地址192.168.0.82 255.255.255.248
现在应该可以从路由器切换交换机,反之亦然。
发布于 2019-06-13 08:56:49
你需要配置即插即用路由器。
interface FastEthernet0/1
switchport trunk allowed vlan 2-11
switchport trunk encapsulation dot1q
switchport mode trunk
switchport nonegotiate
Router(config)# interface g0/0.20
Router(config-subif)# encapsulation dot1q 20
Router(config-subif)# ip add x.x.x.x x.x.x.x
Router(config-subif)# interface g0/0.30
Router(config-subif)# encapsulation dot1q 30
Router(config-subif)# ip add x.x.x.y x.x.x.x
....(add remanining vlan 4,5,6...)
Router(config)# interface g0/0
Router(config-if)# no shuthttps://networkengineering.stackexchange.com/questions/59761
复制相似问题