网站首页/网络技术列表/内容

网络设备中交换机与路由器互联接口是Access还是Trunk

网络技术2024-04-08阅读

近日看到一个VLAN图,为了验证交换机路由器这个箭头所指接口,到底是配成Access类型,还是Trunk类型,特地做了个实验。

<a href='/network/' target='_blank'><u>网络</u></a>设备中交换机与路由器互联接口是Access还是Trunk1

使用模拟器,搭建了下面这个环境,如图所示。

网络设备中交换机与路由器互联接口是Access还是Trunk2

这个图也是我们中小企业,常用的网络拓扑图。

对于路由器RouterB做了如下配置。

<RouterB>DIS CU

#

sysname RouterB

#

undo info-center enable

#

aaa

authentication-scheme default

authorization-scheme default

accounting-scheme default

domain default

domain default_admin

local-user admin password cipher I@qZ>s3UmQjKUGU-KkpBb1>#

local-user admin service-type http

#

firewall zone Local

priority 16

#

interface Ethernet0/0/0

#

interface Ethernet0/0/1

#

interface Serial0/0/0

link-protocol ppp

#

interface Serial0/0/1

link-protocol ppp

#

interface Serial0/0/2

link-protocol ppp

#

interface Serial0/0/3

link-protocol ppp

#

interface GigabitEthernet0/0/0

ip address 192.168.60.254 255.255.255.0

#

interface GigabitEthernet0/0/1

ip address 2.2.2.3 255.255.255.0

#

interface GigabitEthernet0/0/2

ip address 60.60.60.61 255.255.255.0

#

interface GigabitEthernet0/0/3

#

wlan

#

interface NULL0

#

ip route-static 192.168.10.0 255.255.255.0 192.168.60.253

ip route-static 192.168.20.0 255.255.255.0 192.168.60.253

#

user-interface con 0

user-interface vty 0 4

user-interface vty 16 20

#

return

<RouterB>

针对交换机JRJHJ5,做了如下配置

<JRJHJ5>dis current-configuration

#

sysname JRJHJ5

#

undo info-center enable

#

vlan batch 10 20 60 999

#

cluster enable

ntdp enable

ndp enable

#

dhcp enable

#

diffserv domain default

#

drop-profile default

#

ip pool vlan10

gateway-list 192.168.10.254

network 192.168.10.0 mask 255.255.255.0

dns-list 202.102.192.68

#

aaa

authentication-scheme default

authorization-scheme default

accounting-scheme default

domain default

domain default_admin

local-user admin password simple admin

local-user admin service-type http

#

interface Vlanif1

#

interface Vlanif10

ip address 192.168.10.254 255.255.255.0

dhcp select global

#

interface Vlanif20

ip address 192.168.20.254 255.255.255.0

#

interface Vlanif60

#

interface Vlanif999

ip address 192.168.60.253 255.255.255.0

#

interface MEth0/0/1

#

interface GigabitEthernet0/0/1

port link-type access

port default vlan 10

#

interface GigabitEthernet0/0/2

port link-type access

port default vlan 10

#

interface GigabitEthernet0/0/10

port link-type access

port default vlan 20

#

interface GigabitEthernet0/0/11

#

interface GigabitEthernet0/0/12

#

interface GigabitEthernet0/0/24

description ToRouter

port link-type access

port default vlan 999

#

interface NULL0

#

ip route-static 0.0.0.0 0.0.0.0 192.168.60.254

#

user-interface con 0

user-interface vty 0 4

#

return

<JRJHJ5>

测试配置

网络设备中交换机与路由器互联接口是Access还是Trunk3


此交换机接口配置为Access类型,若将交换机与路由器连接的端口配置成Trunk口,经过测试是不能互通的。

相关阅读