文本版|topic 高级搜索
   名人堂 帮助 论坛制度 意见反馈 | 首页 博客 周新贴 招聘 专题 新闻
RSS 底部
 
社区导航: 专家门诊   网络技术   操作系统   数据库   程序设计   系统应用   考试认证   CIO及信息化   站长交流   综合交流   下载基地  51CTO产品服务 设为首页 | 收藏本站
51CTO技术论坛» 思科技术 » 关于两个网段的通信       [ 打印]  [ 订阅]  [ 收藏]  [ 推荐给朋友]   [ 本帖文本页]

论坛跳转:
     
标题: 关于两个网段的通信  ( 查看:200  回复:9 )   
 该主题悬赏的20无忧币已被全部领完 
 
黑夜凌晨
新新人类  点击可查看详细



帖子 17
精华 0
无忧币 4
积分 49
阅读权限 20
注册日期 2008-4-11
最后登录 2008-7-7 离线

[查看资料]  [发短消息]  [Blog
       
发表于:2008-4-12 11:53   标题:关于两个网段的通信
上一帖 |
一个路由器上有两个以太网接口,一个接口E1IP:172.16.1.1 一个接口E2IP:192.168.1.1
E1连一个交换机S1,交换机下有个PC1  ip 172.16.1.2,E2连一个交换机S2,交换机S2下有个PC2
ip 192.168.1.2
请问如何在路由器上敲命令使PC2可以和PC1互相通信呀

在线等答案





网络工程师到底该不该去考CCIE认证?
2008-4-12 11:531楼
[ 顶部 ]
 
menghu
新新人类  点击可查看详细



帖子 32
精华 0
无忧币 99
积分 29
阅读权限 20
注册日期 2008-4-4
最后登录 2008-7-23 离线

[查看资料]  [发短消息]  [Blog
       
发表于:2008-4-12 12:34  该回复被 黑夜凌晨 奖励 20 点无忧币
此回复于2008-04-12 13:34被 黑夜凌晨 评为最佳答案

R1#config t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int s2/1
R1(config-if)#ip add 172.16.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#int s2/2
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#^Z
R1#pi
*Apr 12 12:58:36.007: %SYS-5-CONFIG_I: Configured from console by console
R1#ping 172.16.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/25/48 ms
R1#ping 192.168.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R1#ping 192.168.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
..
Success rate is 0 percent (0/2)
R1#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/46/132 ms
R1#
R1#ping 192.168.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/29/64 ms
R1#ping 192.168.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/34/64 ms
R1#config t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip route 192.168.1.0 255.255.255.0 172.16.1.1
%Invalid next hop address (it's this router)
R1(config)#     
PC1#config t
Enter configuration commands, one per line.  End with CNTL/Z.
PC1(config)#int s2/1
PC1(config-if)#ip add 172.16.1.2 255.255.255.0
PC1(config-if)#no shut
PC1(config-if)#ip de
PC1(config-if)#exit
PC1(config)#ip de
PC1(config)#ip default-172.16.1.1 255.255.255.0
                       ^
% Invalid input detected at '^' marker.

PC1(config)#ip default-g172.16.1.1            
PC1(config)#ip default-g 172.16.1.1
PC1(config)#no ip routing
PC1(config)#^Z
PC1#
*Apr 12 12:57:09.287: %SYS-5-CONFIG_I: Configured from console by console
PC1#ping 192.168.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/30/72 ms
PC1#ping 192.168.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 48/57/64 ms
PC2#config t
Enter configuration commands, one per line.  End with CNTL/Z.
PC2(config)#int s2/1
PC2(config-if)#ip add 192.168.1.2 255.255.255.0
PC2(config-if)#no shut
PC2(config-if)#exit
PC2(config)#ip de
PC2(config)#ip default-g
PC2(config)#ip default-gateway 192.168.1.1
PC2(config)#no ip routing
PC2(config)#^Z
PC2#
*Apr 12 13:00:08.223: %SYS-5-CONFIG_I: Configured from console by console
PC2#
*Apr 12 13:00:15.011: IP: s=192.168.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:00:15.015: IP: tableid=0, s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), routed via RIB
*Apr 12 13:00:15.015: IP: s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), len 100, sending
*Apr 12 13:00:15.079: IP: s=192.168.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:00:15.083: IP: tableid=0, s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), routed via RIB
*Apr 12 13:00:15.083: IP: s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), len 100, sending
*Apr 12 13:00:15.095: IP: s=192.168.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:00:15.095: IP: tableid=0, s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), routed via RIB
*Apr 12 13:00:15.095: IP: s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), len 100, sending
*Apr 12 13:00:15.103: IP: s=192.168.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:00:15.103: IP: tableid=0, s=192.168.1.2 (local), d=192.
PC2#168.1.1 (Serial2/1), routed via RIB
*Apr 12 13:00:15.103: IP: s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), len 100, sending
*Apr 12 13:00:15.111: IP: s=192.168.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:00:15.115: IP: tableid=0, s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), routed via RIB
*Apr 12 13:00:15.115: IP: s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), len 100, sending
PC2#
*Apr 12 13:00:17.135: IP: s=192.168.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:00:17.139: IP: tableid=0, s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), routed via RIB
*Apr 12 13:00:17.139: IP: s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), len 100, sending
*Apr 12 13:00:17.167: IP: s=192.168.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:00:17.171: IP: tableid=0, s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), routed via RIB
*Apr 12 13:00:17.171: IP: s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), len 100, sending
*Apr 12 13:00:17.199: IP: s=192.168.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:00:17.203: IP: tableid=0, s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), routed via RIB
*Apr 12 13:00:17.203: IP: s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), len 100, sending
*Apr 12 13:00:17.207: IP: s=192.168.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:00:17.211: IP: tableid=0, s=192.168.1.2 (local), d=192.
PC2#168.1.1 (Serial2/1), routed via RIB
*Apr 12 13:00:17.211: IP: s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), len 100, sending
*Apr 12 13:00:17.223: IP: s=192.168.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:00:17.227: IP: tableid=0, s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), routed via RIB
*Apr 12 13:00:17.227: IP: s=192.168.1.2 (local), d=192.168.1.1 (Serial2/1), len 100, sending
PC2#
*Apr 12 13:01:11.359: IP: s=172.16.1.2 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:11.363: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), routed via RIB
*Apr 12 13:01:11.363: IP: s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), len 100, sending
*Apr 12 13:01:11.411: IP: s=172.16.1.2 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:11.415: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), routed via RIB
*Apr 12 13:01:11.415: IP: s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), len 100, sending
*Apr 12 13:01:11.483: IP: s=172.16.1.2 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:11.487: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), routed via RIB
*Apr 12 13:01:11.487: IP: s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), len 100, sending
*Apr 12 13:01:11.547: IP: s=172.16.1.2 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:11.547: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), routed via RIB
*Apr 12 13:01:11.547: IP: s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), len 100, sending
*Apr 12 13:01:11.591: IP: s=172.16.1.2 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:11.595: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), routed via RIB
PC2#
*Apr 12 13:01:11.595: IP: s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), len 100, sending
PC2#ping 172.16.1.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/38/80 ms
PC2#
*Apr 12 13:01:24.239: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.1 (Serial2/1), routed via RIB
*Apr 12 13:01:24.243: IP: s=192.168.1.2 (local), d=172.16.1.1 (Serial2/1), len 100, sending
*Apr 12 13:01:24.319: IP: s=172.16.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:24.323: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.1 (Serial2/1), routed via RIB
*Apr 12 13:01:24.323: IP: s=192.168.1.2 (local), d=172.16.1.1 (Serial2/1), len 100, sending
*Apr 12 13:01:24.355: IP: s=172.16.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:24.359: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.1 (Serial2/1), routed via RIB
*Apr 12 13:01:24.363: IP: s=192.168.1.2 (local), d=172.16.1.1 (Serial2/1), len 100, sending
*Apr 12 13:01:24.395: IP: s=172.16.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:24.399: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.1 (Serial2/1), routed via RIB
*Apr 12 13:01:24.399: IP: s=192.168.1.2 (local), d=172.16.
PC2#1.1 (Serial2/1), len 100, sending
*Apr 12 13:01:24.419: IP: s=172.16.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:24.423: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.1 (Serial2/1), routed via RIB
*Apr 12 13:01:24.423: IP: s=192.168.1.2 (local), d=172.16.1.1 (Serial2/1), len 100, sending
*Apr 12 13:01:24.447: IP: s=172.16.1.1 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
PC2#ping 172.16.1.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/39/124 ms
PC2#
*Apr 12 13:01:27.555: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), routed via RIB
*Apr 12 13:01:27.559: IP: s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), len 100, sending
*Apr 12 13:01:27.679: IP: s=172.16.1.2 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:27.687: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), routed via RIB
*Apr 12 13:01:27.691: IP: s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), len 100, sending
*Apr 12 13:01:27.723: IP: s=172.16.1.2 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:27.727: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), routed via RIB
*Apr 12 13:01:27.727: IP: s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), len 100, sending
*Apr 12 13:01:27.747: IP: s=172.16.1.2 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:27.751: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), routed via RIB
*Apr 12 13:01:27.751: IP: s=192.168.1.2 (local), d=172.16.
PC2#1.2 (Serial2/1), len 100, sending
*Apr 12 13:01:27.759: IP: s=172.16.1.2 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
*Apr 12 13:01:27.763: IP: tableid=0, s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), routed via RIB
*Apr 12 13:01:27.763: IP: s=192.168.1.2 (local), d=172.16.1.2 (Serial2/1), len 100, sending
*Apr 12 13:01:27.771: IP: s=172.16.1.2 (Serial2/1), d=192.168.1.2, len 100, rcvd 1
PC2#no debug ip pac
IP packet debugging is off
PC2#



网络工程师到底该不该去考CCIE认证?
2008-4-12 12:342楼
[ 顶部 ]
 
menghu
新新人类  点击可查看详细



帖子 32
精华 0
无忧币 99
积分 29
阅读权限 20
注册日期 2008-4-4
最后登录 2008-7-23 离线

[查看资料]  [发短消息]  [Blog
       
发表于:2008-4-12 12:34 
配置个协议就可以啊 !



网络工程师到底该不该去考CCIE认证?
2008-4-12 12:343楼
[ 顶部 ]
 
menghu
新新人类  点击可查看详细



帖子 32
精华 0
无忧币 99
积分 29
阅读权限 20
注册日期 2008-4-4
最后登录 2008-7-23 离线

[查看资料]  [发短消息]  [Blog
       
发表于:2008-4-12 12:36 
启用rip协议啊 !就可以 !



网络工程师到底该不该去考CCIE认证?
2008-4-12 12:364楼
[ 顶部 ]
 
menghu
新新人类  点击可查看详细



帖子 32
精华 0
无忧币 99
积分 29
阅读权限 20
注册日期 2008-4-4
最后登录 2008-7-23 离线

[查看资料]  [发短消息]  [Blog
       
发表于:2008-4-12 12:38 
router rip
ver 2
net 192.168.1.0
net 172.16.1.0
no au
应该可以通的!因为交换机是一个2层设备,它不其什么作用的!你看你的端口打开没有!



网络工程师到底该不该去考CCIE认证?
2008-4-12 12:385楼
[ 顶部 ]
 
xart
新新人类  点击可查看详细



帖子 95
精华 0
无忧币 112
积分 123
阅读权限 20
注册日期 2007-9-27
最后登录 2008-7-21 离线

[查看资料]  [发短消息]  [Blog
  QQ       
发表于:2008-4-12 12:39 
不用路由协议啊 ,就在P上配置好网管关 啊!



网络工程师到底该不该去考CCIE认证?
2008-4-12 12:396楼
[ 顶部 ]
 
menghu
新新人类  点击可查看详细



帖子 32
精华 0
无忧币 99
积分 29
阅读权限 20
注册日期 2008-4-4
最后登录 2008-7-23 离线

[查看资料]  [发短消息]  [Blog
       
发表于:2008-4-12 13:05 
我在没交换机的情况下做的 !应该是一样的 !



网络工程师到底该不该去考CCIE认证?
2008-4-12 13:057楼
[ 顶部 ]
 
hjxqj2000
新新人类  点击可查看详细



帖子 117
精华 0
无忧币 100
积分 177
阅读权限 20
注册日期 2007-7-14
最后登录 2008-7-17 离线

[查看资料]  [发短消息]  [Blog
       
发表于:2008-4-12 13:09 
配个协议就好了,RIP可以,OSPF可以,IGRP也可以



网络工程师到底该不该去考CCIE认证?
2008-4-12 13:098楼
[ 顶部 ]
 
wzg11240
新新人类  点击可查看详细



帖子 1
精华 0
无忧币 11
积分 1
阅读权限 20
注册日期 2008-4-5
最后登录 2008-4-12 离线

[查看资料]  [发短消息]  [Blog
       
发表于:2008-4-12 13:38 
写俩静态路由就好了,没那么复杂吧?



网络工程师到底该不该去考CCIE认证?
2008-4-12 13:389楼
[ 顶部 ]
 
benandbo
新新人类  点击可查看详细


帖子 97
精华 0
无忧币 478
积分 157
阅读权限 20
注册日期 2007-10-18
最后登录 2008-7-21 离线

[查看资料]  [发短消息]  [Blog
  QQ      Yahoo!    淘宝旺旺 
发表于:2008-4-12 17:04 
配个协议就好了,RIP可以



用户必读,51CTO积分系统调整通知
2008-4-12 17:0410楼
[ 顶部 ]
     
论坛跳转:  

| | |

| | |

| | |

标记已读 · 删除论坛Cookies · 文本版 · WAP
 
| 诚征版主 | 版主堂 | 意见建议 | 大史记 | 论坛地图
Copyright©2005-2008 51CTO.COM  Powered by Discuz!
本论坛言论纯属发布者个人意见,不代表51CTO网站立场!如有疑义,请与管理员联系。
京ICP备05051492号