我的问题是:我无法连接到网络 192.168.1.0。我哪里错了?这是我的 cisco 命令。此外,“show ip route”命令没有输出。
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#no ip route 192.168.1.0 255.255.255.0 192.168.1.2
Router(config)#wr
Router#sh 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 not set
172.168.0.0/24 is subnetted, 1 subnets
C 172.168.1.0 is directly connected, Serial0/1/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0
Router#sh run
Building configuration...
Current configuration : 627 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
!
!
!
!
no ip domain-lookup
!
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.2.254 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Serial0/1/0
ip address 172.168.1.2 255.255.255.0
ipv6 ospf cost 781
!
interface Vlan1
no ip address
shutdown
!
ip classless
ip route 192.168.1.0 255.255.255.0 172.16.1.1
!
!
!
no cdp run
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
答案1
假设您想通过 Serial0/1/0 发送流量,则需要仔细检查输入的 IP 地址是否正确。Serial0/1/0 的 IP 地址为 172.168.1.2,而路由的 IP 地址为 172.16.1.1。
答案2
您指向的 IP 地址不在您的路由表中。当然它不会起作用。我认为应该是这样的:ip route 192.168.1.0 255.255.255.0 Serial 0/1/0
答案3
这可能是打字错误:您习惯于输入 192.168.xx,以至于当您输入 172.16.xx 时,您实际上输入的是 172.168.xx,并添加了“8”。
答案4
就像 xciter 说的,路由器上没有 192.168.1.0 接口。你的意思是
- IP路由 192.168.1.0 255.255.255.0 172.16.1.1