7. Nat的配置
進入fa0/0.7子接口
Router(config)#int fa0/0.7
定義接口爲 NAT 的本地內部接口
Router(config-if)#ip nat inside
進入fa0/0.8子接口
Router(config-if)#int fa0/0.8
定義接口爲 NAT 的本地內部接口
Router(config-if)#ip nat inside
進入fa0/0.9子接口
Router(config-if)#int fa0/0.9
定義接口爲 NAT 的本地內部接口
Router(config-if)#ip nat inside
進入S1/0子接口
Router(config-if)#int s1/0
定義接口爲 NAT 的本地全局接口
Router(config-if)#ip nat outside
定義nat的本地全局地址
Router(config)#ip nat pool vlan 202.102.192.100 202.102.192.100 netmask 255.255.255.0
定義ACL控制列表
Router(config)#access-list 1 permit any
本地全局地址和ACL的綁定
Router(config)#ip nat inside source list 1 pool vlan overload
8. 靜態路由的配置實現router和ISP的通信
Router(confing)#ip route 0.0.0.0 0.0.0.0 202.102.192.200
9. 查看router表
Router#sh ip route
C 192.168.1.0/24 is directly connected, FastEthernet0/0.7
C 192.168.2.0/24 is directly connected, FastEthernet0/0.8
C 192.168.3.0/24 is directly connected, FastEthernet0/0.9
C 202.102.192.0/24 is directly connected, Serial1/0
S* 0.0.0.0/0 [1/0] via 202.102.192.200
10. 檢測內部網絡是否可以和外部網絡的通信
PC>ping 202.102.192.200
Pinging 202.102.192.200 with 32 bytes of data:
Reply from 202.102.192.200: bytes=32 time=16ms TTL=254
Reply from 202.102.192.200: bytes=32 time=14ms TTL=254
Reply from 202.102.192.200: bytes=32 time=16ms TTL=254
Reply from 202.102.192.200: bytes=32 time=14ms TTL=254
Ping statistics for 202.102.192.200:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 14ms, Maximum = 16ms, Average = 15ms
11. CHAP的配置
定義router的名字
Router(config)#hostname vlan
建立CHAP用戶和密碼
Vlan(config)#username isp password cicso
進入S1/0接口
Vlan(config)#int s1/0
封裝ppp協議
Vlan(config-if)#encapsulation ppp
定義CHAP驗證
Vlan(config-if)#ppp auth chap
12. Isp 的配置
Router(config)#hostname isp
Router(config)#username vlan password cicso
Router(config-if)#encapsulation ppp
Router(config-if)#ppp auth chap
13. 檢測相同用戶名是否可以通信,不同用戶名是否可以通信。
相同的用戶名
vlan#ping 202.102.192.200
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 202.102.192.200, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 3/4/7 ms
不同的用戶名
四:實驗總結
1. 通過vlan的劃分可以實現不同部門之間的隔離,防止網絡內部廣播風暴。
2. 通過router的功能可以實現內部不同vlan的之間的通信。
3. 通過NAT技術可以實現私有地址可以訪問外網。節約ip地址和降低成本。
4. 通過CHAP技術可以保證router的安全防止外部網絡的惡意***。