思科三层交换机路由功能配置教程
普通交换机工作在链路层,即二层交换机,无路由功能,也就是只能同一个网段的机器才能通信。
而三层交换机可以在网络层配置路由功能,使不同网段的设备可以通信。现以思科3550交换机为例配置三层路由功能。以实现如下拓扑通信。
----------------------------------
| 思科3550三层交换机 |
---- -------------------- -------
50.1.1.1 (23口) 60.1.1.1(24口)
|| ||
|| ||
50.1.1.2 60.1.1.2
(pc1) (pc2)
配置23口:
Switch#enable
Switch#configure terminal
Switch(config)#interface fastEthernet 0/23
Switch(config)ip addr 50.1.1.1 255.255.255.0
Switch(config-if)#no switchport
Switch(config-if)#no shutdown
Switch(config-if)#end
类似的配置24口:
Switch#enable
Switch#configure terminal
Switch(config)#interface fastEthernet 0/24
Switch(config)ip addr 60.1.1.1 255.255.255.0
Switch(config-if)#no switchport
Switch(config-if)#no shutdown
Switch(config-if)#end
打开交换机路由转发开关:
Switch#configure terminal
Switch(config)#ip routing
Switch(config)#ip cef (这个默认是打开的)
此时可以查看下23口的状态:
Switch#show interfaces fastEthernet 0/23
此时在交换机上ping两个口的地址成功:
Switch#ping 50.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 50.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Switch#ping 60.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 60.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Switch#
pc1(win7)增加路由:
到60.1.1.0/24的数据包通过50.1.1.1转发:
route ADD 60.1.1.0 MASK 255.255.255.0 50.1.1.1 METRIC 3
对应的pc2也增加路由:
route ADD 50.1.1.0 MASK 255.255.255.0 60.1.1.1 METRIC 3
此时50.1.1.2和60.1.1.2即可通信。
如果使用了交换机口的路由功能,那么此口(即这里的23,24口)就没有交换能力了。
如果又要交换机有路由功能,又有交换功能,那么交换功能可以由其它口负担。
答:三层有两种方法可以和路由连上:1 把三层那个接路由的口switchport acc vlan1 int vlan1 ip add 192.168.1.x 255.255.255.0 然后 路由 ip add192.168.1.x 255.255.255.0 no shut 这是用交换的svi接口 第二种:进入三层交换那个和路由相连接的口 no switchport 然后直接 ip add 就好了...
答:搭载先进的安全防护系统,搜狗高速浏览器为您的网络生活提供全方位保护。访问https://sogou.37moyu.com/,立即下载体验。 基本思科三层交换机配置命令 1. 交换机支持的命令: 交换机基本状态:switch: ;ROM状态, 路由器是rommon>hostname> ;用户模式hostname# ;特权模式hostname(config)# ;全局配置...
答:#exit Switch(config)#interface f0/24 Switch(config-if)#switchport mode trunk 配置与三层设备连接的f0/24为trunk模式 Switch(config-if)#switchport allow vlan all 配置允许所有VLAN通过 quit Switch(config)ip routing 开启三层交换机的路由功能(这条命令开启之后VLAN之间就可以通信了)
答:在三层交换机上配置RIP路由协议,以三层交换机代替路由器。通过RIP实现路由间通信 动态路由协议配置灵活,路由器会发送自身的路由信息给其他路由器,同时也会接收其他路由器发来的路由信息建立自己的路由表。这样在路由器上就不必像静态路由那样为每个目标地址都配置路由,因为路由器可以通过协议学习这些路由。
答:PC1 IP: 192.168.1.2 Submask: 255.255.255.0 Gateway: 192.168.1.1 PC2 IP: 192.168.2.2 Submask: 255.255.255.0 Gateway: 192.168.2.1 验证PC1、PC2主机之间可以互相同信;猜你喜欢:1. 新版斐讯p.to路由器的设置教程 2. 斐讯fir303c路由器怎么设置上网 3. 在三层交换机配置...
答:然后配置三层交换机的联网外网,和外面的路由器连内网的问题了:enable configure terminal interface fastethernet0/24 switchport mode trunk no switchport ip address 10.139.172.17 255.255.255.0 exit ip route 0.0.0.0 0.0.0.0 10.139.172.18 右边路由器,配置路由 ip route 192.168.0...
答:步骤2.配置三层交换机端口的路由功能。S3550-24(config)#interface fastethernet 0/5 S3550-24(config-if)#no switchport !开启端口的三层路由功能 S3550-24(config-if)#ip address 192.168.5.1 255.255.255.0 ! 给端口配置IP地址 S3550-24(config-if)#no shutdown S3550-24(config-if...
答://在vlan 接口上配置IP 地址即可,VLAN 1 接口上的地址就是PC1 的'网关了,VLAN 2 接口 上的地址就是PC2 的网关了。注意事项:要在三层交换机上启用路由功能,还需要启用CEF(命令为:ip cef),不过这是默认值。和路由器一样,三层交换机上同样可以运行路由协议。4. 实验调试 (1) 检查S1 上的...
答:no ip admain-lookup 关闭路由器的域名查找ip routing 在三层交换机上启用路由功能 show user 查看SW的在线用户clear line +线路号 清除线路3. 三层交换机配置命令配置一组二层端口configure terminal 进入配置状态nterface range {port-range} 进入组配置状态配置三层端口configure terminal 进入配置状态interface {{...
答:三层交换机路由配置:interface Vlanif2 //此为PC1的网关 ip address 192.168.1.254 255.255.255.0 interface Vlanif12 //此为交换机1和2的直连路由 ip address 1.1.1.1 255.255.255.252 interface GigabitEthernet0/0/1 port link-type access port default vlan 2 interface Gigabit...