Cisco Packet Tracer 配置网络实例---包括单臂路由-3层交换机-NAT的配置

                                                                        配置文件下载地址: 模拟器配置文件

  

     说明:需要配置单臂路由的路由器                                                        

                                                

说明:需要配置NAT的路由器-----我用台电脑代替了外网

                 

 说明:具有路由功能的3层交换机

              

           只有过程没有原理,想知道什么是静态路由啊之类的,请问度娘!!具体的ip地址规划。请看大图。。仅供参考

 switch 0    : 

Switch(config)#vlan 10       .....创建VLAN 10

Switch(config)#vlan 20       ......创建VLAN 20

!

interface FastEthernet0/1       。。。将接口0/1设置为TRUNK 模式
 switchport mode trunk
!
interface FastEthernet1/1       。。。将接口1/1划入VLAN 10
 switchport access vlan 10
 switchport mode access
!
interface FastEthernet2/1      。。。。将接口2/1划入VLAN 20
 switchport access vlan 20
 switchport mode access

单臂路由:

    

interface FastEthernet0/0.1                            。。。。进入接口0/0的字接口0/0.1
 encapsulation dot1Q 10                                 。。。。设置封装协议

 ip address 192.168.10.1 255.255.255.0    。。。。。  设置子接口ip 
!
interface FastEthernet0/0.2                                同上
 encapsulation dot1Q 20
 ip address 192.168.20.1 255.255.255.0
!

interface FastEthernet1/0                                       。。。。进入接口1/0
 ip address 192.168.60.1 255.255.255.0             。。。。配置1/0接口IP

Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.60.254        。。。。。。添加默认路由


 

                                                                                                  以上把单臂路由配置好了

Router1: (外网的接口路由。需配置NAT)

interface FastEthernet0/0                                        。。。。进入 0/0接口
 ip address 60.60.60.1 255.255.255.0                  。。。。配置0/0IP

ip nat outside                                                               。。。。。指定网络的外部接口 (可以多个外部接口)

interface FastEthernet1/0                                        。。。。。进入1/0
 ip address 192.168.60.254 255.255.255.0         。。。。。配置0/0IP

 ip nat inside                                                                。。。。。指定网络的内部接口

interface FastEthernet2/0                                          。。。。进入2/0
 ip address 192.168.80.1 255.255.255.0                ............配置IP地址

 ip nat inside                                                                   。。。。指定为内部接口

ip nat inside source static 192.168.10.2 60.60.60.2                      。。。。建立静态NAT ,将私有IP 192.168.10.2 与公有地址 60.60.60.2对应
ip nat inside source static 192.168.20.2 60.60.60.3                       。。。。同上
ip nat inside source static 192.168.30.2 60.60.60.4                        。。。。同上
ip nat inside source static 192.168.30.3 60.60.60.5                         。。。。同上
ip nat inside source static 192.168.40.2 60.60.60.6                         。。。。同上
ip nat inside source static 192.168.40.3 60.60.60.7                        。。。。同上
ip nat inside source static 192.168.30.5 60.60.60.8                          
ip nat inside source static 192.168.52.2 60.60.60.9                          。。。。同上

ip route 192.168.10.0 255.255.255.0 192.168.60.1                             .............添加静态路由,到192.168.10.0  网段的包全通过 地址 192.168.60.0转发
ip route 192.168.20.0 255.255.255.0 192.168.60.1                             。。。。。同上
ip route 192.168.90.0 255.255.255.0 192.168.80.254                         。。。。。同上
ip route 192.168.30.0 255.255.255.0 192.168.80.254                          。。。。。同上
ip route 192.168.40.0 255.255.255.0 192.168.80.254                          。。。。。同上
ip route 192.168.52.0 255.255.255.0 192.168.80.254                           。。。。。同上
!

                                                           以上是NAT 功能路由的配置

Router2:

interface FastEthernet0/0                                           ......进入接口0/0
 ip address 192.168.90.1 255.255.255.0                 ......配置IP

interface FastEthernet1/0                                                      同上
 ip address 192.168.80.254 255.255.255.0                       同上

ip route 192.168.10.0 255.255.255.0 192.168.80.1                     .............添加静态路由,到192.168.10.0  网段的包全通过 地址 192.168.80.0转发
ip route 192.168.20.0 255.255.255.0 192.168.80.1                      。。。。。同上 
ip route 192.168.60.0 255.255.255.0 192.168.80.1                       。。。。。同上
ip route 192.168.30.0 255.255.255.0 192.168.90.254                    。。。。。同上
ip route 192.168.40.0 255.255.255.0 192.168.90.254                   。。。。。同上
ip route 60.60.0.0 255.255.0.0 192.168.80.1                                  。。。。。同上   这是到外网的静态路由  

3层交换机:

ip routing                                                    。。。。。。。开启3层交换机路由功能

interface FastEthernet0/1                        。。。。。。  进入接口 0/1
 no switchport                                            。。。。。。。是针对具体端口,使此端口变为三层端口

 ip address 192.168.90.254 255.255.255.0      。。。。。。。配置0/1接口IP   和路由器接口差不多

!
interface FastEthernet0/2                          .....................
 switchport access vlan 10
!
interface FastEthernet0/3
 switchport access vlan 20
!
interface FastEthernet0/4                               
 switchport mode trunk                                     。。。。。。。。将接口该为trunk模式
!

interface Vlan10                                                     。。。。。。进入VLAN 10的配置模式

 ip address 192.168.30.1 255.255.255.0          。。。。。。将VLAN 10 的IP配置为192.168.30.1      (VLAN 10 里面PC的网关)

interface Vlan20                                                       。。。。。。同上
 ip address 192.168.40.1 255.255.255.0
!
interface Vlan30                                                       。。。。。。。同上
 ip address 192.168.52.1 255.255.255.0
!

ip route 0.0.0.0 0.0.0.0 192.168.90.1                    。。。。。。。默认路由
ip route 60.60.0.0 255.255.0.0 192.168.90.1      。。。。。。。静态路由---到外网的静态路由


 

                                                                                   以上是3层交换机的配置

Switch1:

interface FastEthernet0/1             ........进入接口0/1
 switchport mode trunk                 。。。。。。设置为trunk 模式(因为要实现跨VLAN的通信)

interface FastEthernet1/1                。。。。进入接口1/1
 switchport access vlan 10              。。。。。将接口划入VLAN 10
 switchport mode access

interface FastEthernet2/1              。。。。。 同上
 switchport access vlan 10
 switchport mode access

Switch3:  和Switch1配置相同

Switch2:

!
interface FastEthernet0/1         。。。同上
 switchport mode trunk

interface FastEthernet1/1         。。。同上
 switchport access vlan 10
 switchport mode access

interface FastEthernet2/1        。。。。 进入接口2/1
 switchport access vlan 30     。。。。。将VLAN30 划入接口2/1
 switchport mode access

pc配置切图:         请查看大图上的IP与之一一对应

details:配置的时候 你需要仔细看最上面的图片、、

           那些命令在那些模式下配置,没有指明。

            请大神指导,评论

            如果你做单臂路由器的时候没有encapsulation封装命令。那么是因为你的路由器的版本太低。你需要更新路由器的iso。具体教程请百度

                                      

指导教师:冯德勇          双星教育高级讲师            moshu.ruancc.com

  • 3
    点赞
  • 68
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值