路由技术 交换技术
   无线技术 综合技术 解决方案
   网络管理 网络协议 网络设备
   考试认证 juniper专题
3G纵览 数据通信
   光通信 智能网 WIMAX VOIP
   IPTV NGN
安全产品 病毒防治
    防火墙 安全方案 IDS/IPS    DOS/DDOS
存储技术 存储设备
   存储方案 服务器专区

Google
 
作者: 发布时间:2008-04-23 08:44:09 来源:八条线收集整理
 

 我单位是一个规模较小的单位,用的是D-Link的设备,结构图如下:

dd53c8886d6a8ae2827ebfcf1ce45c1f.jpg

其思路主要是在设置好路由器DI-602HB+,这个路由器有3个端口,我把其中的一个千兆端口G2连接了外网,把其他的2个端口G1(千兆),FA1(100M)连接了三层交换机,路由情况配置如下:

  R1#sh run

  Building configuration...

 

  Current configuration:

  !

  service timestamps log date

  service timestamps debug date

  no service password-encryption

  !

  hostname R1

  !

  !

  ip domain name-server address 219.150.32.132

  ip domain name-server address 218.30.64.97

  !

  !

  isdn switch-type basic-5ess

  !

  aaa authentication login default line

  aaa authentication enable default enable line

  !

  enable password 0 ********** level 15

  !

  interface FastEthernet0/0

  ip address 172.168.13.2 255.255.255.0 //连接三层交换机器的一个端口IP

  no ip directed-broadcast

  ip nat inside

  !

  interface GigaEthernet0/1

  ip address 192.168.10.2 255.255.255.0  //连接三层交换机的一个端口IP

  no ip directed-broadcast

  ip nat inside

  !

  interface GigaEthernet0/2

  ip address 202.96.64.51 255.255.255.0 //电信给我们的一个IP

  no ip directed-broadcast

  ip nat outside

  !

  interface Async0/0

  no ip address

  no ip directed-broadcast

  !

  !

  !

  line vty 0

  password 0 **********

  !

  line vty 1

  password 0 **********

  !

  line vty 2

  password 0 **********

  !

  line vty 3

  password 0 **********

  !

  line vty 4

  password 0 **********

  !

  line vty 5

  password 0 **********

  !

  !

  !

  !

  ip route default 202.96.64.49

  ip route 192.168.0.0 255.255.255.0 172.168.13.1

  ip route 192.168.1.0 255.255.255.0 172.168.13.1

  ip route 192.168.2.0 255.255.255.0 172.168.13.1

  ip route 192.168.4.0 255.255.255.0 172.168.13.1

  ip route 192.168.5.0 255.255.255.0 172.168.13.1

  ip route 192.168.6.0 255.255.255.0 172.168.13.1

  ip route 192.168.30.0 255.255.255.0 192.168.10.1

  ip route 192.168.50.0 255.255.255.0 192.168.10.1

  ip route 192.168.100.0 255.255.255.0 192.168.10.1

  ip route 192.168.150.0 255.255.255.0 192.168.10.1

  ip route 192.168.170.0 255.255.255.0 192.168.10.1

  ip route 192.168.200.0 255.255.255.0 192.168.10.1

  !

  !

  !

  ip access-list extended NAT_2008

  permit ip any any

  !

  !

  !

  !

  ip nat service privateservice

  ip nat outside destination static tcp 202.96.64.51 80 192.168.100.254 80

  ip nat outside destination static tcp 202.96.64.51 21 192.168.100.254 21

  ip nat inside source static tcp 192.168.100.254 80 202.96.64.51 80

  ip nat inside source static tcp 192.168.100.254 21 202.96.64.51 21

  ip nat inside source static tcp 192.168.100.254 5631 202.96.64.51 5631

  ip nat inside source static tcp 192.168.100.254 5632 202.96.64.51 5632

  ip nat inside source list NAT_2008 interface GigaEthernet0/2

  !

  需要注意的是这段代码:

  ip route default 202.96.64.49 //这个电信给你的网关

  ip route 192.168.0.0 255.255.255.0 172.168.13.1

  //192.168.0.0是你三层交换机下连接的网段,172.168.13.1是交换机上的一个虚端口的IP

  ip route 192.168.1.0 255.255.255.0 172.168.13.1

  ip route 192.168.2.0 255.255.255.0 172.168.13.1

  ip route 192.168.4.0 255.255.255.0 172.168.13.1

  ip route 192.168.5.0 255.255.255.0 172.168.13.1

  ip route 192.168.6.0 255.255.255.0 172.168.13.1

  ip route 192.168.30.0 255.255.255.0 192.168.10.1

  ip route 192.168.50.0 255.255.255.0 192.168.10.1

  //192.168.50.0也是你三层交换机连接的的一个网段,192.168.10.1也是交换机上的一个虚端口IP.

  ip route 192.168.100.0 255.255.255.0 192.168.10.1

  ip route 192.168.150.0 255.255.255.0 192.168.10.1

  ip route 192.168.170.0 255.255.255.0 192.168.10.1

  ip route 192.168.200.0 255.255.255.0 192.168.10.1

  而最后的是代码:

  ip nat service privateservice //开启回流,否则内网不可以用域名访问自己的主机。

  ip nat outside destination static tcp 202.96.64.51 80 192.168.100.254 80

  ip nat outside destination static tcp 202.96.64.51 21 192.168.100.254 21

  ip nat inside source static tcp 192.168.100.254 80 202.96.64.51 80

  ip nat inside source static tcp 192.168.100.254 21 202.96.64.51 21

  ip nat inside source static tcp 192.168.100.254 5631 202.96.64.51 5631

  ip nat inside source static tcp 192.168.100.254 5632 202.96.64.51 5632

  是你要对外发布的服务。

  以上是路由器的配置,交换机上我只做了简单内容:

  划分VLAN,并且在交换机上也要指定路由,其实就是在交换机和路由器上要互相指定路由,

  比如我的是:

  ip route default 192.168.10.2 //192.168.10.2正好要对应路由器上的端口IP 。

※ 相关信息
无相关信息
 

  最新文章

·网络配置讲解之路由器加三
·VLAN+路由器典型配置实例
·DLINK DI-504路由器共享上
·Cisco HSRP的配置 双机热
·Cisco路由器交换机安全配
·设定路由访存表防止黑客对
·让下载更顺畅 如何打通路
·合理配置路由命令 管好网
·常见路由器关闭端口
·利用UNIX系统的TFTP和RCP
 

  热门文章

·cisco2621路由器NAT配置实
·思科路由器常用配置命令大
·路由器IP地址怎样设置
·十九个路由器配置经典问题
·CISCO配置命令大全
·华为MT800路由设置
·华为路由器qos car+nat+d
·实例:教你如何进入路由器
·华为AR28-31路由器的配置
·在RouterOS中修改mac地址
 
 

 

Copyright ? 2006 All rights reserved