设为首页收藏本站language 语言切换
查看: 1946|回复: 6
收起左侧

[求助] 三层交换静态路由实验配置出错?求助

[复制链接]
发表于 2017-1-20 15:02:15 | 显示全部楼层 |阅读模式
3鸿鹄币
用的是Cisco Packet Tracer6.0,我查了下是不是要在三层上做TRUNK的时候加个L3SW2(config-if)#switchport mode trunk  access这个后面加一句?但我加过没用,都看得到直连路由,就是不能PING通!
C    192.168.1.0/24 is directly connected, FastEthernet0/24
C    192.168.2.0/24 is directly connected, GigabitEthernet0/1
C    192.168.10.0/24 is directly connected, Vlan10
C    192.168.20.0/24 is directly connected, Vlan20
S    192.168.30.0/24 [1/0] via 192.168.2.2
S    192.168.40.0/24 [1/0] via 192.168.2.2

Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line.  End with CNTL/Z.

L3SW1#
%SYS-5-CONFIG_I: Configured from console by console
writ
Building configuration...
[OK]
L3SW1#
L3SW1#
L3SW1#sho ip rou
L3SW1#sho ip route
Codes: C - connected, S - static, I - IGRP, 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 192.168.1.1 to network 0.0.0.0

C    192.168.1.0/24 is directly connected, FastEthernet0/24
C    192.168.2.0/24 is directly connected, GigabitEthernet0/1
C    192.168.10.0/24 is directly connected, Vlan10
C    192.168.20.0/24 is directly connected, Vlan20
S    192.168.30.0/24 [1/0] via 192.168.2.2
S    192.168.40.0/24 [1/0] via 192.168.2.2
S*   0.0.0.0/0 [1/0] via 192.168.1.1
L3SW1#
L3SW1#
L3SW1#
L3SW1#sho run
L3SW1#sho running-config
Building configuration...

Current configuration : 1550 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname L3SW1
!
!
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode trunk
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
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
no switchport
ip address 192.168.1.2 255.255.255.0
duplex auto
speed auto
!
interface GigabitEthernet0/1
no switchport
ip address 192.168.2.1 255.255.255.0
duplex auto
speed auto
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
ip address 192.168.10.1 255.255.255.0
!
interface Vlan20
ip address 192.168.20.1 255.255.255.0
!
ip classless
ip route 192.168.30.0 255.255.255.0 192.168.2.2
ip route 192.168.40.0 255.255.255.0 192.168.2.2
ip route 0.0.0.0 0.0.0.0 192.168.1.1
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end

最佳答案

查看完整内容

额,描述不太清楚,你直连ping的哪个地址呢。不过思科模拟器默认没开启三层功能,在config视图下执行命令Switch(config)#ip routing 试试
发表于 2017-1-20 15:02:16 | 显示全部楼层
额,描述不太清楚,你直连ping的哪个地址呢。不过思科模拟器默认没开启三层功能,在config视图下执行命令Switch(config)#ip routing 试试
沙发 2017-1-20 15:02:16 回复 收起回复
回复

使用道具 举报

发表于 2017-1-20 17:10:44 | 显示全部楼层
拓扑没有,谁也给不了你解答 除非你是就这一台不通
板凳 2017-1-20 17:10:44 回复 收起回复
回复

使用道具 举报

发表于 2017-1-20 21:52:39 | 显示全部楼层
附加这些命令的输出,以便我们可以更好地了解:

show vlan
show interface trunk
show interface status
show ip interface brief
地板 2017-1-20 21:52:39 回复 收起回复
回复

使用道具 举报

 楼主| 发表于 2017-1-22 16:34:32 | 显示全部楼层
Q9966 发表于 2017-1-20 21:52
附加这些命令的输出,以便我们可以更好地了解:

show vlan

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/2, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Fa0/15, Fa0/16, Fa0/17
                                                Fa0/18, Fa0/19, Fa0/20, Fa0/21
                                                Fa0/22, Fa0/23, Fa0/24, Gig0/1
                                                Gig0/2
30   VLAN0030                         active   
40   VLAN0040                         active   
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup






Port        Mode         Encapsulation  Status        Native vlan
Fa0/1       on           802.1q         trunking      1

Port        Vlans allowed on trunk
Fa0/1       1-1005

Port        Vlans allowed and active in management domain
Fa0/1       1,30,40

Port        Vlans in spanning tree forwarding state and not pruned
Fa0/1       1,30,40











L3SW2#sho ip interface brief
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/1        unassigned      YES unset  up                    up

FastEthernet0/2        unassigned      YES unset  down                  down

FastEthernet0/3        unassigned      YES unset  down                  down

FastEthernet0/4        unassigned      YES unset  down                  down

FastEthernet0/5        unassigned      YES unset  down                  down

FastEthernet0/6        unassigned      YES unset  down                  down

FastEthernet0/7        unassigned      YES unset  down                  down

FastEthernet0/8        unassigned      YES unset  down                  down

FastEthernet0/9        unassigned      YES unset  down                  down

FastEthernet0/10       unassigned      YES unset  down                  down

FastEthernet0/11       unassigned      YES unset  down                  down

FastEthernet0/12       unassigned      YES unset  down                  down

FastEthernet0/13       unassigned      YES unset  down                  down

FastEthernet0/14       unassigned      YES unset  down                  down

FastEthernet0/15       unassigned      YES unset  down                  down

FastEthernet0/16       unassigned      YES unset  down                  down

FastEthernet0/17       unassigned      YES unset  down                  down

FastEthernet0/18       unassigned      YES unset  down                  down

FastEthernet0/19       unassigned      YES unset  down                  down

FastEthernet0/20       unassigned      YES unset  down                  down

FastEthernet0/21       unassigned      YES unset  down                  down

FastEthernet0/22       unassigned      YES unset  down                  down

FastEthernet0/23       unassigned      YES unset  down                  down

FastEthernet0/24       unassigned      YES unset  down                  down

GigabitEthernet0/1     192.168.2.2     YES manual up                    up

GigabitEthernet0/2     unassigned      YES unset  down                  down

Vlan1                  unassigned      YES unset  administratively down down

Vlan30                 192.168.30.1    YES manual up                    up

Vlan40                 192.168.40.1    YES manual up                    up
5# 2017-1-22 16:34:32 回复 收起回复
回复

使用道具 举报

发表于 2017-1-22 23:51:41 | 显示全部楼层
L3SW2在192.168.1.0/24网络上没有接口。
在L3SW1,默认路由发送到192.168.1.1,但是192.168.1.1 在哪里?
6# 2017-1-22 23:51:41 回复 收起回复
回复

使用道具 举报

发表于 2017-2-10 16:50:43 | 显示全部楼层
你的VLAN30和VLAN40 没有网关啊
VLAN10和VLAN20才有
你是从哪ping去哪?
7# 2017-2-10 16:50:43 回复 收起回复
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-7 19:54 , Processed in 0.056978 second(s), 13 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表