R1在的配置 :
[R1]inter
[R1]interface e0/0/0
[R1-Ethernet0/0/0]ip add
[R1-Ethernet0/0/0]ip address 192.168.2.2 24
[R1]ip route-static 192.168.1.0 255.255.255.0 192.168.2.1 靜態(tài)路由
開啟虛擬終端服務
[R1]user-interface vty 0 4
[R1-ui-vty0-4]set authentication password
[R1-ui-vty0-4]set authentication password cipher 666
[R1-ui-vty0-4]user privilege level 3
R2的配置
[R2]interface e0/0/0
[R2-Ethernet0/0/0]ip add 192.168.1.2 24
[R2-Ethernet0/0/0]q
[R2]ip route-static 192.168.2.0 24 192.168.1.1
[R2]user-interface vty 0 4
[R2-ui-vty0-4]authentication-mode password
[R2-ui-vty0-4]set authentication password cipher 666
[R2-ui-vty0-4]user privilege level 3
防火墻配置
配置接口地址:
interface GigabitEthernet0/0/0
ip address 192.168.2.1 255.255.255.0
interface GigabitEthernet0/0/1
ip address 192.168.1.1 255.255.255.0
創(chuàng)建區(qū)域outside,設置優(yōu)先級30, 并把接口G0/0/1加入到該區(qū)域
firewall zone name outside
set priority 30
add interface GigabitEthernet0/0/1
查看區(qū)域默認策略
[SRG]display policy interzone local outside outbound
policy interzone local outside outbound
firewall default packet-filter is permit
檢測能否ping 通外部的路由器。是可以的。
更改默認策略
[SRG]firewall packet-filter default deny interzone local outside direction outbound
檢測能否ping 通外部的路由器。是不可以的,
還原默認策略
[SRG]firewall packet-filter default permit interzone local outside direction outbound
檢驗 R1和R2能否 telnet 和ping 通 ,結果應該是不通。
怎么可以讓R1telnet到R2上 并且ping 通,要放行trust 和outside 之間outbound方向流量 ,如下 :
放行outbound 方向telnet 和ICMP的流量
[SRG]policy interzone trust outside outbound
[SRG-policy-interzone-trust-outside-outbound]policy 1
[SRG-policy-interzone-trust-outside-outbound-1]policy source 192.168.2.2 0
[SRG-policy-interzone-trust-outside-outbound-1]policy destination 192.168.1.2 0
[SRG-policy-interzone-trust-outside-outbound-1]policy service service-set icmp telnet
[SRG-policy-interzone-trust-outside-outbound-1]action permit
[SRG-policy-interzone-trust-outside-outbound-1]q
[SRG-policy-interzone-trust-outside-outbound]q
用R1 去telnet R2,成功登錄后來 在防火墻上查看會話表
[SRG]display firewall session table
Current Total Sessions : 1
icmp ×××:public --> public 192.168.2.2:53419-->192.168.1.2:2048
[SRG]display firewall session table
09:46:55 2018/05/11
Current Total Sessions : 0
請思考如何放行outside的主機telnet 到內部的路由器上????
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。