免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2596 | 回复: 8
打印 上一主题 下一主题

迷茫~中午不吃饭做实验,nat有问题了,求解! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-17 12:34 |只看该作者 |倒序浏览


路由器配置:
                        
      
Router#sho run              
Building configuration...                        

Current configuration : 1301                           
!
version 12.4            
service timestamps debug datetime msec                                      
service timestamps log datetime msec                                    
no service password-encryption                              
!
hostname Router               
!
boot-start-marker                 
boot-end-marker               
!
!
no aaa new-model               
!
resource policy               
!
ip subnet-zero              
!
!
ip cef      
no ip dhcp use vrf connected                           
ip dhcp excluded-address 192.168.0.1 192.168.0.50                                                
ip dhcp excluded-address 192.168.1.1 192.168.1.50                                                
!
ip dhcp pool vlan                 
   network 192.168.0.0 255.255.0.0                                 
   domain-name dhl.com                     
   dns-server 211.167.97.67 202.106.0.20                                       
!
ip dhcp pool vlan14                  
   network 192.168.0.0 255.255.255.0                                    
   default-router 192.168.0.1                             
!
ip dhcp pool vlan15                  
   network 192.168.1.0 255.255.255.0                                    
   default-router 192.168.1.1        
   
                  
!
!
!
!
!
!
interface FastEthernet0/0                        
no ip address              
duplex auto            
speed auto           
!
interface FastEthernet0/0.3                           
!
interface FastEthernet0/0.14                           
encapsulation dot1Q 14                       
ip address 192.168.0.1 255.255.255.0                                    
no snmp trap link-status                        
!
interface FastEthernet0/0.15                           
encapsulation dot1Q 15                       
ip address 192.168.1.1 255.255.255.0                                    
no snmp trap link-status                        
!
interface FastEthernet0/1
ip address 10.210.148.250 255.255.255.0
duplex auto
speed auto

!
ip classless
!
ip http server
ip nat inside source static 192.168.1.10 10.210.148.10
!
!
control-plane
!
!
line con 0
line aux 0
line vty 0 4
login
!
scheduler allocate 20000 1000
!
end

------------------------------------------------------------------------------------------------------------------------------------
交换机配置:
Switch#sho run              
Building configuration...                        

Current configuration : 2056 bytes                                 
!
version 12.2            
no service pad              
service timestamps debug uptime                              
service timestamps log uptime                             
no service password-encryption                              
!
hostname S        
!
!
no aaa new-model               
system mtu routing 1500                       
ip subnet-zero              
!
!
!
!
no file verify auto                  
spanning-tree mode pvst                       
spanning-tree extend system-id                              
!
vlan internal allocation policy ascending                                         
!
interface FastEthernet0/1                        
!
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                          
switchport mode trunk                     
!
interface FastEthernet0/14                          
switchport access vlan 14                          
switchport mode access                       
!
interface FastEthernet0/15                          
switchport access vlan 15                          
switchport mode access                       
!

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                          
!
interface FastEthernet0/25                          
!
interface FastEthernet0/26                        
!
interface FastEthernet0/27                          
!
interface FastEthernet0/28                          
!
interface FastEthernet0/29                          
!
interface FastEthernet0/30                          
!
interface FastEthernet0/31                          
!
interface FastEthernet0/32                          
!
interface FastEthernet0/33                          
!
interface FastEthernet0/34                          
!
interface FastEthernet0/35                          
!
interface FastEthernet0/36                          
!
interface FastEthernet0/37                          
!
interface FastEthernet0/38                          
!
interface FastEthernet0/39                          
!
interface FastEthernet0/40                          
!
interface FastEthernet0/41                          
!
interface FastEthernet0/42                          
!
interface FastEthernet0/43                          
!
interface FastEthernet0/44                          
!
interface FastEthernet0/45                          
!
interface FastEthernet0/46                          
!
interface FastEthernet0/47                          
!
interface FastEthernet0/48                          
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
no ip route-cache
shutdown
!
ip http server
!
control-plane
!
!
line con 0
line vty 0 4
login
line vty 5 15
login
!
end

--------------------------------------------------------------------------------------------------------------------------


如图

test PC 连接F0/15口 设置IP 192.168.1.10为什么ping不同公司网络10.210.148.1呢?

首先排除了10.210.148.10没被占用 10.210.148.1可以ping等

而且可以ping通10.210.148.250

把router F0/1 IP 设成10.210.148.1.10 也不行

最后加了这两句话也不行
Router(config)#in f0/0                     
Router(config-if)#ip nat in                           
Router(config-if)#no sh                       
Router(config-if)#exi                     
Router(config)#in f0/1                     
Router(config-if)#ip nat ou                           
Router(config-if)#no sh  

谁知道我错在哪了呢?谢谢啦

nat.JPG (24.48 KB, 下载次数: 56)

nat.JPG

论坛徽章:
3
辰龙
日期:2013-11-20 23:03:57子鼠
日期:2014-05-26 14:46:482015年亚洲杯之伊拉克
日期:2015-01-30 14:29:38
2 [报告]
发表于 2008-12-17 13:14 |只看该作者
interface FastEthernet0/0.15
ip nat inside
interface FastEthernet0/1
ip nat outside

加上去试一下

论坛徽章:
0
3 [报告]
发表于 2008-12-17 14:28 |只看该作者
原帖由 seven007 于 2008-12-17 13:14 发表
interface FastEthernet0/0.15
ip nat inside
interface FastEthernet0/1
ip nat outside

加上去试一下



哈  搞定了

甚是感谢~

不过还一个小问题   能ping通公司网络的网关了  但却上不了网呢  acl我也没设呢啊

论坛徽章:
3
辰龙
日期:2013-11-20 23:03:57子鼠
日期:2014-05-26 14:46:482015年亚洲杯之伊拉克
日期:2015-01-30 14:29:38
4 [报告]
发表于 2008-12-17 14:57 |只看该作者
原帖由 pingtelnet 于 2008-12-17 14:28 发表



哈  搞定了

甚是感谢~

不过还一个小问题   能ping通公司网络的网关了  但却上不了网呢  acl我也没设呢啊

呵呵,慢慢来啊

论坛徽章:
0
5 [报告]
发表于 2008-12-17 15:11 |只看该作者
原帖由 seven007 于 2008-12-17 14:57 发表

呵呵,慢慢来啊

不是啊,我能ping到公司网关了,但上不了外网呢

DNS也设置了:em11:

论坛徽章:
3
辰龙
日期:2013-11-20 23:03:57子鼠
日期:2014-05-26 14:46:482015年亚洲杯之伊拉克
日期:2015-01-30 14:29:38
6 [报告]
发表于 2008-12-17 15:16 |只看该作者
你们10.210.148.10可以直接上网吗?
tracert 外部网的某个地址看看

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
7 [报告]
发表于 2008-12-17 15:55 |只看该作者
兄弟你加缺省路由了吗?
DNS你分配网关了吗?

论坛徽章:
0
8 [报告]
发表于 2008-12-17 15:55 |只看该作者
我PC直接连工位设置成10.210.148.10
tracert 163的IP
C:\Documents and Settings\lvan>tracert 61.135.253.10

Tracing route to 61.135.253.10 over a maximum of 30 hops

  1     1 ms    <1 ms    <1 ms  10.210.148.1
  2     2 ms     2 ms     2 ms  131.124.218.1
  3     5 ms     5 ms     6 ms  220.231.53.1
  4    12 ms     7 ms     7 ms  10.1.49.1
  5     6 ms     4 ms     7 ms  10.0.10.5
  6     *        5 ms     9 ms  119.253.0.9
  7    10 ms     7 ms     7 ms  203.86.64.82
  8    30 ms    19 ms     9 ms  203.86.64.81
  9     4 ms     6 ms     3 ms  211.154.209.185
10    14 ms     4 ms     4 ms  61.51.26.213
11    11 ms     6 ms     6 ms  61.51.26.209
12     5 ms     9 ms     6 ms  61.148.142.109
13     *       51 ms    15 ms  bt-229-254.bta.net.cn [202.106.229.254]
14    39 ms    31 ms     *     bt-229-042.bta.net.cn [202.106.229.42]
15    65 ms    49 ms    11 ms  61.49.41.138
16     8 ms     *       23 ms  61.135.253.10

Trace complete.

------------------------------------------------------------------------------------
我连接交换机-路由-工位设置192.168.1.10 nat 成10.210.148.10能ping通网关10.210.148.1



C:\Documents and Settings\lvan>ping 61.135.253.10

Pinging 61.135.253.10 with 32 bytes of data:

Reply from 192.168.1.1: Destination host unreachable.
Reply from 192.168.1.1: Destination host unreachable.
Reply from 192.168.1.1: Destination host unreachable.
Reply from 192.168.1.1: Destination host unreachable.

Ping statistics for 61.135.253.10:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

--------------------------------

C:\Documents and Settings\lvan>tracert 61.135.253.10

Tracing route to 61.135.253.10 over a maximum of 30 hops

  1    <1 ms    <1 ms    <1 ms  192.168.1.1
  2  192.168.1.1  reports: Destination host unreachable.

Trace complete.
-------------------------------------------------
192.168.1.1是我路由器的F0/0.15

!
interface FastEthernet0/0.15
encapsulation dot1Q 15
ip address 192.168.1.1 255.255.255.0
ip nat inside
no snmp trap link-status
!



我更加迷茫啦~~好像是路由器还得增加什么设置吧?路由器解析不到?

请赐教

论坛徽章:
0
9 [报告]
发表于 2008-12-17 16:29 |只看该作者
原帖由 ssffzz1 于 2008-12-17 15:55 发表
兄弟你加缺省路由了吗?
DNS你分配网关了吗?


哈哈哈 对您的感谢都难以用语言表达了

缺省路由 Router(config)#ip route 0.0.0.0 0.0.0.0 10.210.148.1

DNS不用写网关也行

现在我是设192.168.1.10回复的

今天没白活
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP