允许10.10.1.0子网内的主机访问测试服务器
拒绝10.10.2.0子网内的主机访问测试服务器
在实验路由器上加命令
access-list 1 permit 10.10.1.10 0.0.0.255
interface f0/0
ip access-group 1 in
2.扩展ACL
允许网段一及网段二ping通测试服务器
允许网段一但不允许网段二访问内部网络的TELNET服务
在实验路由器上加命令
access-list 101 permit icmp any any echo
access-list 101 permit icmp any any echo-reply
access-list 101 permit tcp 10.10.1.0 0.0.0.255 172.16.1.0 0.0.0.255 eq 23
interface f0/0
ip access-group 101 in
在测试服务器上
line vty 0 4
password 123
login
在PC1和PC2上ping测试服务器,再telnet
查看ACL
show access-list
show ip route
(以上是cisco的配置)
shiyan路由器
<Quidway>system
[Quidway]sysname shiyan
[shiyan]interface e0/0
[shiyan-fastethernet0/0]ip address 192.168.1.1 255.255.255.0
[shiyan-fastethernet0/0]undo shutdown
[shiyan-fastethernet0/0]quit
[shiyan]interface e0/1
[shiyan-fastethernet0/0]ip address 172.16.1.10 255.255.255.0
[shiyan-fastethernet0/0]undo shutdown
[shiyan-fastethernet0/0]quit
[shiyan]ip routing
[shiyan]ip route-static 10.10.1.0 255.255.255.0 192.168.1.1
[shiyan]ip route-static 10.10.2.0 255.255.255.0 192.168.1.1
<Quidway>system
[Quidway]sysname ceshi
[ceshi]interface e0/1
[ceshi-Serial0/0]ip address 172.16.1.10 255.255.255.0
[ceshi-Serial0/0]undo shutdown
[ceshi-Serial0/0]quit
[ceshi]ip routing
[ceshi]ip route-static 0.0.0.0 0.0.0.0 172.16.1.1
允许10.10.1.0子网内的主机访问测试服务器
拒绝10.10.2.0子网内的主机访问测试服务器
在实验路由器上加命令
[shiyan]firewall enable
[shiyan]firewall default permit
[shiyan]acl number 2001
[shiyan-acl-basic-2001]rule normal deny source 10.10.2.0 0.0.0.255
[shiyan-acl-basic-2001]rule normal permit source any
[shiyan-acl-basic-2001]quit
[shiyan]interface ethernet0/0
[shiyan-Ethernet0/0]firewall packet-filter 2001 inbound
[shiyan-Ethernet0/0]quit
允许网段一及网段二ping通测试服务器
允许网段一但不允许网段二访问内部网络的TELNET服务
在测试服务器上加命令
[ceshi]user-interface vty 0 4
(以上是华维的配置)