学员提问:
我有二台PC直接用网线连到ASA的端口上,如果我想限制这好台PC除了访问外网的邮件服务器外(我的邮件服务器是租用SINA),其他任何的外部网络都不让这二台PC上,这二台PC的IP地址没有进行绑定。
我的配置如下:
BH-ASA5505# sh run int
!
interface Vlan10
nameif outside
security-level 0
ip address 202.101.150.118 255.255.255.252
!
interface Vlan11
nameif inside
security-level 100
ip address 192.168.1.11 255.255.255.0
!
interface Ethernet0/0
switchport access vlan 10
!
interface Ethernet0/1
switchport access vlan 11
!
interface Ethernet0/2
switchport access vlan 11
!
interface Ethernet0/3
switchport access vlan 11
!
interface Ethernet0/4
switchport access vlan 11
!
interface Ethernet0/5
switchport access vlan 11
!
interface Ethernet0/6
switchport access vlan 11
!
interface Ethernet0/7
switchport access vlan 11
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505# sh run route
route outside 0.0.0.0 0.0.0.0 202.101.150.117 1
BH-ASA5505#
BH-ASA5505#
BH-ASA5505# sh run acce
BH-ASA5505# sh run access-l
BH-ASA5505# sh run access-list
access-list for_nat extended permit ip 192.168.1.128 255.255.255.128 any
access-list for_nat extended permit tcp 192.168.1.0 255.255.255.128 any eq smtp
access-list for_nat extended permit tcp 192.168.1.0 255.255.255.128 any eq pop3
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505# sh run nat
nat (inside) 1 access-list for_nat
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505# sh run gl
BH-ASA5505# sh run global
global (outside) 1 interface
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505# sh run
: Saved
:
ASA Version 8.2(1)
!
hostname BH-ASA5505
domain-name baihe.com
enable password eJBDZtqiLOg.lITf encrypted
passwd eJBDZtqiLOg.lITf encrypted
names
!
interface Vlan10
nameif outside
security-level 0
ip address 202.101.150.118 255.255.255.252
!
interface Vlan11
nameif inside
security-level 100
ip address 192.168.1.11 255.255.255.0
!
interface Ethernet0/0
switchport access vlan 10
!
interface Ethernet0/1
switchport access vlan 11
!
interface Ethernet0/2
switchport access vlan 11
!
interface Ethernet0/3
switchport access vlan 11
!
interface Ethernet0/4
switchport access vlan 11
!
interface Ethernet0/5
switchport access vlan 11
!
interface Ethernet0/6
switchport access vlan 11
!
interface Ethernet0/7
switchport access vlan 11
!
ftp mode passive
dns server-group DefaultDNS
domain-name baihe.com
access-list for_nat extended permit ip 192.168.1.128 255.255.255.128 any
access-list for_nat extended permit tcp 192.168.1.0 255.255.255.128 any eq smtp
access-list for_nat extended permit tcp 192.168.1.0 255.255.255.128 any eq pop3
pager lines 24
logging asdm informational
mtu outside 1500
mtu inside 1500
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 access-list for_nat
route outside 0.0.0.0 0.0.0.0 202.101.150.117 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
dynamic-access-policy-record DfltAccessPolicy
http server enable
http 0.0.0.0 0.0.0.0 outside
http 0.0.0.0 0.0.0.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
crypto ipsec security-association lifetime seconds 28800
crypto ipsec security-association lifetime kilobytes 4608000
telnet 192.168.0.0 255.255.0.0 inside
telnet timeout 5
ssh 0.0.0.0 0.0.0.0 outside
ssh 0.0.0.0 0.0.0.0 inside
ssh timeout 5
console timeout 0
dhcpd dns 218.85.157.99 202.101.112.55
dhcpd auto_config inside
!
dhcpd address 192.168.1.16-192.168.1.31 inside
dhcpd enable inside
!
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
!
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum 512
policy-map global_policy
class inspection_default
inspect dns preset_dns_map
inspect ftp
inspect h323 h225
inspect h323 ras
inspect rsh
inspect rtsp
inspect esmtp
inspect sqlnet
inspect skinny
inspect sunrpc
inspect xdmcp
inspect sip
inspect netbios
inspect tftp
inspect icmp
!
service-policy global_policy global
prompt hostname context
Cryptochecksum:5e92e93f52b578403541c3472fd6e248
: end
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505# wr
Building configuration...
Cryptochecksum: 5e92e93f 52b57840 3541c347 2fd6e248
3090 bytes copied in 1.570 secs (3090 bytes/sec)
[OK]
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
我的配置如下:
BH-ASA5505# sh run int
!
interface Vlan10
nameif outside
security-level 0
ip address 202.101.150.118 255.255.255.252
!
interface Vlan11
nameif inside
security-level 100
ip address 192.168.1.11 255.255.255.0
!
interface Ethernet0/0
switchport access vlan 10
!
interface Ethernet0/1
switchport access vlan 11
!
interface Ethernet0/2
switchport access vlan 11
!
interface Ethernet0/3
switchport access vlan 11
!
interface Ethernet0/4
switchport access vlan 11
!
interface Ethernet0/5
switchport access vlan 11
!
interface Ethernet0/6
switchport access vlan 11
!
interface Ethernet0/7
switchport access vlan 11
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505# sh run route
route outside 0.0.0.0 0.0.0.0 202.101.150.117 1
BH-ASA5505#
BH-ASA5505#
BH-ASA5505# sh run acce
BH-ASA5505# sh run access-l
BH-ASA5505# sh run access-list
access-list for_nat extended permit ip 192.168.1.128 255.255.255.128 any
access-list for_nat extended permit tcp 192.168.1.0 255.255.255.128 any eq smtp
access-list for_nat extended permit tcp 192.168.1.0 255.255.255.128 any eq pop3
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505# sh run nat
nat (inside) 1 access-list for_nat
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505# sh run gl
BH-ASA5505# sh run global
global (outside) 1 interface
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505# sh run
: Saved
:
ASA Version 8.2(1)
!
hostname BH-ASA5505
domain-name baihe.com
enable password eJBDZtqiLOg.lITf encrypted
passwd eJBDZtqiLOg.lITf encrypted
names
!
interface Vlan10
nameif outside
security-level 0
ip address 202.101.150.118 255.255.255.252
!
interface Vlan11
nameif inside
security-level 100
ip address 192.168.1.11 255.255.255.0
!
interface Ethernet0/0
switchport access vlan 10
!
interface Ethernet0/1
switchport access vlan 11
!
interface Ethernet0/2
switchport access vlan 11
!
interface Ethernet0/3
switchport access vlan 11
!
interface Ethernet0/4
switchport access vlan 11
!
interface Ethernet0/5
switchport access vlan 11
!
interface Ethernet0/6
switchport access vlan 11
!
interface Ethernet0/7
switchport access vlan 11
!
ftp mode passive
dns server-group DefaultDNS
domain-name baihe.com
access-list for_nat extended permit ip 192.168.1.128 255.255.255.128 any
access-list for_nat extended permit tcp 192.168.1.0 255.255.255.128 any eq smtp
access-list for_nat extended permit tcp 192.168.1.0 255.255.255.128 any eq pop3
pager lines 24
logging asdm informational
mtu outside 1500
mtu inside 1500
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 access-list for_nat
route outside 0.0.0.0 0.0.0.0 202.101.150.117 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
dynamic-access-policy-record DfltAccessPolicy
http server enable
http 0.0.0.0 0.0.0.0 outside
http 0.0.0.0 0.0.0.0 inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
crypto ipsec security-association lifetime seconds 28800
crypto ipsec security-association lifetime kilobytes 4608000
telnet 192.168.0.0 255.255.0.0 inside
telnet timeout 5
ssh 0.0.0.0 0.0.0.0 outside
ssh 0.0.0.0 0.0.0.0 inside
ssh timeout 5
console timeout 0
dhcpd dns 218.85.157.99 202.101.112.55
dhcpd auto_config inside
!
dhcpd address 192.168.1.16-192.168.1.31 inside
dhcpd enable inside
!
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
!
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum 512
policy-map global_policy
class inspection_default
inspect dns preset_dns_map
inspect ftp
inspect h323 h225
inspect h323 ras
inspect rsh
inspect rtsp
inspect esmtp
inspect sqlnet
inspect skinny
inspect sunrpc
inspect xdmcp
inspect sip
inspect netbios
inspect tftp
inspect icmp
!
service-policy global_policy global
prompt hostname context
Cryptochecksum:5e92e93f52b578403541c3472fd6e248
: end
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505# wr
Building configuration...
Cryptochecksum: 5e92e93f 52b57840 3541c347 2fd6e248
3090 bytes copied in 1.570 secs (3090 bytes/sec)
[OK]
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
BH-ASA5505#
捷盈讲师及学员解答:
如果仅仅需要限制某一PC只可以访邮件的话。你可以通过ACL 来限制,某一IP地址只可以用某一协议访问某些公共IP地址。

