【實驗名稱】
編號的標準IP訪問列表
【實驗目的】
掌握路由器上的編號的標準IP訪問列表規則及配置
【實驗功能】
實現網段間互相訪問的安全控制
【實驗設備】
路由器(2臺)、V35線纜(1條)、交叉線(3條)
【實驗拓撲】
【實驗步驟】
Router 1
Router>enable
Router#configure terminal
Router(config)#interface fastEthernet 0/0
Router(config-if)#no shutdown
Router(config-if)#ip address 172.16.1.2 255.255.255.0
Router(config-if)#exit
Router(config)#interface fastEthernet 1/0
Router(config-if)#no shutdown
Router(config-if)#ip address 172.16.2.2 255.255.255.0
Router(config-if)#exit
Router(config)#interface serial 2/0
Router(config-if)#no shutdown
Router(config-if)#ip address 172.16.3.1 255.255.255.0
Router(config-if)#exit
Router(config)#router ospf 1
Router(config-router)#network 172.16.1.0 255.255.255.0 area 0
Router(config-router)#network 172.16.2.0 255.255.255.0 area 0
Router(config-router)#network 172.16.3.0 255.255.255.0 area 0
Router2
Router>enable
Router#configure terminal
Router(config)#interface serial 2/0
Router(config-if)#no shutdown
Router(config-if)#clock rate 64000
Router(config-if)#ip address 172.16.3.2 255.255.255.0
Router(config-if)#exit
Router(config)#interface fastEthernet 0/0
Router(config-if)#no shutdown
Router(config-if)#ip address 172.16.4.1 255.255.255.0
Router(config-if)#exit
Router(config)#router ospf 1
Router(config-router)#network 172.16.3.0 255.255.255.0 area 0
Router(config-router)#network 172.16.4.0 255.255.255.0 area 0
配置到這裏 發現 全網互聯互通
PC>ping 172.16.2.1
Pinging 172.16.2.1 with 32 bytes of data:
Reply from 172.16.2.1: bytes=32 time=94ms TTL=127
Reply from 172.16.2.1: bytes=32 time=63ms TTL=127
Ping statistics for 172.16.2.1:
Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 63ms, Maximum = 94ms, Average = 78ms
PC>ping 172.16.4.2
Pinging 172.16.4.2 with 32 bytes of data:
Reply from 172.16.4.2: bytes=32 time=110ms TTL=126
Reply from 172.16.4.2: bytes=32 time=94ms TTL=126
Reply from 172.16.4.2: bytes=32 time=93ms TTL=126
Reply from 172.16.4.2: bytes=32 time=94ms TTL=126
Ping statistics for 172.16.4.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 93ms, Maximum = 110ms, Average = 97ms
接下來是本章節重點!(以前都是想方設法讓全網互聯互通,現在開始通的要控制他不通,感覺是不是有點怪!呵呵)
我們現在做的就是控制 172.16.1.0 這個網段的PC 禁止訪問172.16.4.0 這個網段的PC 其他的正常
(控制其他的都大同小異)!
控制 172.16.1.0 這個網段的PC 禁止訪問172.16.4.0 這個網段的PC 我們在Router2上配置
現在有人會問: 爲什麼我要放在Router2上配置啊 Router1 不行嘛?
是這樣的! 我們標準的訪問控制列表 儘量放在靠近源! 因爲如果我放在Router1上 那172.16.1.0 這個網段連我的路由器都出不了 他也就訪問不了172.16.2.0 也就沒有達到我們的效果! 如果我們放在Router2 F0/0口 那效果就不一樣了 ! 大家仔細想想!
Router2
Router#configure terminal
Router(config)#access-list 1 deny 172.16.1.0 0.0.0.255 (拒絕172.16.1.0 這個網段 後面爲 反掩碼)
Router(config)#access-list 1 permit any (允許其他所有的訪問)
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip access-group 1 out (把訪問控制列表1 應用到接口 )
這時發現
PC>ping 172.16.2.1
Pinging 172.16.2.1 with 32 bytes of data:
Reply from 172.16.2.1: bytes=32 time=47ms TTL=127
Reply from 172.16.2.1: bytes=32 time=63ms TTL=127
Reply from 172.16.2.1: bytes=32 time=63ms TTL=127
Reply from 172.16.2.1: bytes=32 time=62ms TTL=127
Ping statistics for 172.16.2.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 47ms, Maximum = 63ms, Average = 58ms
PC>ping 172.16.4.2
Pinging 172.16.4.2 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 172.16.4.2:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
PC1 可以PING通 PC2 但是PING不通 PC3
原創:胡斌
我會從簡單到難的發表一些我學過的知識,希望能給一些想入門的朋友幫助,也希望找一些志同道合的朋友、老師 給我些指教。 QQ 276200261!