nat技術實驗(純乾貨)

在這裏插入圖片描述實驗步驟:
第一步:設置lsw1交換機配置:

-int g0/0/1

-port link-type access

  • port default vlan 10
    -un sh
    -int g0/0/2
    -port link-type access
  • port default vlan 20
    -un sh
    -int g0/0/3
    -port link-type access
  • port default vlan 30
    -un sh
    -int g0/0/4
    -port link-type access
  • port default vlan 20
    -un sh
    -int g0/0/6
    -port link-type access
  • port default vlan 10
    -un sh
    -int g0/0/5
    -port link-type access
  • port default vlan 40
    -un sh
    -int Vlanif 10
    -ip add 192.168.10.1 24
    -int Vlanif 20
    -ip add 192.168.20.1 24
    -int Vlanif 30
    -ip add 192.168.30.1 24
    -int Vlanif 40
    -ip add 11.0.0.2 24
    -Dis ip int b (查看配置信息)
    IP route-static 0.0.0.0 0.0.0.0 11.0.0.1 )
    第二步:設置r1路由器:
    -int g0/0/0
    -ip add 11.0.0.1 24
    -un sh
    -int g0/0/1
    -ip add 12.0.0.1 24
    -un sh
    -ip route-static 0.0.0.0 0.0.0.0 12.0.0.2 向上只默認
    -ip route-static 192.168.10.0 24 11.0.0.2 (數據轉發路由)
    -ip route-static 192.168.20.0 24 11.0.0.2
    -ip route-static 192.168.30.0 24 11.0.0.2 向下靜態的同網段不用寫路由
    (-nat static global 8.8.8.8 inside 192.168.10.10 (pc1)
    -int g0/0/1
    -nat static enable)
    (-nat address-group 1 212.0.0.100 212.0.0.200 (pc20網段)
    -acl 2000 (定義總規則)
    -rule permit source 192.168.20.0 0.0.0.255 (定義總規則的明細)
    -rule permit source 11.0.0.0 0.0.0.255
    -int g0/0/1
    -nat outbound 2000 address-group 1 no-pat ) 公私匹配
    (-acl 3000
    -rule permit ip source 192.168.30.0 0.0.0.255 (pc30網段)
    -int g0/0/1 同網段不需要配回城路由
    -nat outbound 3000 )
    (-int g0/0/1
    -nat server protocol tcp global 9.9.9.9 www inside 192.168.10.100 www

    第三步:設置r2路由器:
    (-int g0/0/0
    -ip add 12.0.0.2 24
    -un sh
    -int g0/0/1
    -ip add 13.0.0.1 24
    -un sh
    -int loo 0
    -ip add 114.114.114.114 32
    -ip route-static 9.9.9.9 32 12.0.0.1 pc服務器
    -ip route-static 8.8.8.8 32 12.0.0.1 pc1
    -ip route-static 212.0.0.0 24 12.0.0.1 pc 2 4
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章