路由器做交换机如何设置,路由器作为交换机如何设置

首页 > 数码 > 作者:YD1662024-05-05 09:43:28

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

路由器做交换机如何设置,路由器作为交换机如何设置(1)

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

路由器做交换机如何设置,路由器作为交换机如何设置(2)

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

对于路由器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>

测试配置

路由器做交换机如何设置,路由器作为交换机如何设置(3)

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

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.