路由器NAT回流简析 主任让我配置一下路由器,好使我们的校内也能通过域名访问,本校的主页。原来我们的主页在校外可以通过域名访问,而在校内却只能通过IP地址。因为,我在配置NAT的时候,没有发现内网不能访问,所以这个问题
路由器NAT回流简析 主任让我配置一下路由器,好使我们的校内也能通过域名访问,本校的主页。原来我们的主页在校外可以通过域名访问,而在校内却只能通过IP地址。因为,我在配置NAT的时候,没有发现内网不能访问,所以这个问题一直到今天才迫切需要解决,呵呵,现在得以解决了。 输入以下两条新命令【便可以搞定----前提是已经配置好了NAT,以及外网能够通过域名访问内网服务器】: www.zhishiwu.com shenzhi_R01_config#ip nat service privateservice shenzhi_R01_config#ip nat outside destination static tcp 1.2.3.4 80 192.168.0.200 8080 -------------------------------------------------------------------------------------- 新的路由器2626配置如下: !version 1.3.3G service timestamps log date service timestamps debug date no service password-encryption ! hostname shenzhi_R01 ! ! ! ! ! ! gbsc group default ! ! ! ! ! ! ! aaa authentication login default local aaa authentication enable default enable ! username shenzhi password 0 enable password 0 level 15 ! ! ! interface FastEthernet0/0 ip address 121.17.40.109 255.255.255.0 no ip directed-broadcast ip nat outside ! interface FastEthernet0/3 no ip address no ip directed-broadcast ip nat inside ! interface FastEthernet0/3.1 ip address 192.168.1.99 255.255.255.0 no ip directed-broadcast encapsulation dot1Q 11 bandwidth 100000 delay 1 ip nat inside ! interface FastEthernet0/3.2 ip address 192.168.2.99 255.255.255.0 no ip directed-broadcast encapsulation dot1Q 12 bandwidth 100000 delay 1 ip nat inside ! interface FastEthernet0/3.3 ip address 192.168.3.99 255.255.255.0 no ip directed-broadcast encapsulation dot1Q 13 bandwidth 100000 delay 1 ip nat inside ! interface FastEthernet0/3.4 ip address 192.168.4.99 255.255.255.0 no ip directed-broadcast encapsulation dot1Q 14 bandwidth 100000 delay 1 ip nat inside ! interface FastEthernet0/3.5 ip address 192.168.5.99 255.255.255.0 no ip directed-broadcast encapsulation dot1Q 15 bandwidth 100000 delay 1 ip nat inside ! interface FastEthernet0/3.6 ip address 192.168.6.99 255.255.255.0 no ip directed-broadcast encapsulation dot1Q 16 bandwidth 100000 delay 1 ip nat inside ! interface FastEthernet0/3.7 ip address 192.168.7.99 255.255.255.0 no ip directed-broadcast encapsulation dot1Q 17 bandwidth 100000 delay 1 ip nat inside ! interface FastEthernet0/3.10 ip address 192.168.0.99 255.255.255.0 no ip directed-broadcast encapsulation dot1Q 10 bandwidth 100000 delay 1 ip nat inside ! interface Serial0/1 no ip address no ip directed-broadcast ! interface Serial0/2 no ip address no ip directed-broadcast ! interface Async0/0 no ip address no ip directed-broadcast ! ! ! ! ! ! ! ! ! ip route default 121.17.40.1 ip route 202.99.160.0 255.255.255.0 121.17.40.1 ip route 202.99.166.0 255.255.255.0 121.17.40.1 ! ! ! ! ! ! ! ! ! ! ! ip access-list standard shenzhi_nat_access permit 192.168.0.0 255.255.255.0 ! ip access-list standard shenzhi_nat_access permit 192.168.0.0 255.255.255.0 permit 192.168.1.0 255.255.255.0 permit 192.168.2.0 255.255.255.0 permit 192.168.3.0 255.255.255.0 permit 192.168.4.0 255.255.255.0 permit 192.168.5.0 255.255.255.0 permit 192.168.6.0 255.255.255.0 permit 192.168.7.0 255.255.255.0 ! ! ! ! ! ! ip nat service privateservice ip nat outside destination static tcp 1.2.3.4 80 192.168.0.200 8080 ip nat inside source static tcp 192.168.0.200 8080 1.2.3.4 80 ip nat inside source list shenzhi_nat_access interface FastEthernet0/0 ! !