1. 程式人生 > >Cisco Packet Tracer 配置網路例項---包括單臂路由-3層交換機-NAT的配置

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。具體教程請百度

聯絡郵箱:[email protected]