Cấu hình để router hạn chế IP address spoofing
Bước 1: Cấu hình địa chỉ IP, định tuyến, static NAT
Router 4
!
interface Loopback0
ip address 150.1.4.4 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
ip address 155.1.45.4 255.255.255.0
ip nat outside
ip virtual-reassembly
speed auto
!
interface FastEthernet0/1
ip address 10.0.0.4 255.255.255.0
ip nat inside
ip virtual-reassembly
speed auto
!
!
router ospf 1
log-adjacency-changes
network 150.1.4.0 0.0.0.255 area 0
network 155.1.45.0 0.0.0.255 area 0
!
ip classless
!
ip nat inside source static 10.0.0.1 interface Loopback0
!
Router 5
!
interface FastEthernet0/0
ip address 155.1.45.5 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 150.1.5.5 255.255.255.0
duplex auto
speed auto
no keepalive
!
router ospf 1
log-adjacency-changes
network 150.1.5.0 0.0.0.255 area 0
network 155.1.45.0 0.0.0.255 area 0
!
Router 1
!
interface FastEthernet0/0
ip address 10.0.0.1 255.255.255.0
duplex auto
speed auto
!
ip classless
ip route 0.0.0.0 0.0.0.0 10.0.0.4
!
Bước 2: Tạo access-list INSIDE_IN và OUTSIDE_IN
Router 4
!
no ip source-route
!
ip access-list extended INSIDE_IN
deny icmp any any redirect
permit ip 10.0.0.0 0.0.0.255 any
permit udp host 0.0.0.0 host 10.0.0.4 eq bootps
deny ip any any log
ip access-list extended OUTSIDE_IN
remark ==
remark == attacker có thể dùng redirect để spoofing
remark ==
deny icmp any any redirect
remark ==
remark == RFC 1918
remark ==
deny ip 10.0.0.0 0.255.255.255 any
deny ip 172.16.0.0 0.15.255.255 any
deny ip 192.168.0.0 0.0.255.255 any
remark ==
remark == RFC 3330
remark ==
deny ip host 0.0.0.0 any
deny ip 224.0.0.0 31.255.255.255 any
deny ip 127.0.0.0 0.255.255.255 any
deny ip 169.254.0.0 0.0.255.255 any
deny ip 192.0.2.0 0.0.0.255 any
remark ==
remark == RFC 2627
remark ==
deny ip 150.1.4.0 0.0.0.255 any
remark ==
remark == End of List
remark ==
permit ip any any
!
!
Router 4
!
interface FastEthernet0/0
ip access-group OUTSIDE_IN in
!
interface FastEthernet0/1
ip access-group INSIDE_IN in
!
Bước 3: Kiểm tra
Router 4
R4#show ip access-lists
Extended IP access list INSIDE_IN
10 deny icmp any any redirect
20 permit ip 10.0.0.0 0.0.0.255 any
30 permit udp host 0.0.0.0 host 10.0.0.4 eq bootps
40 deny ip any any log
Extended IP access list OUTSIDE_IN
10 deny icmp any any redirect
20 deny ip 10.0.0.0 0.255.255.255 any
30 deny ip 172.16.0.0 0.15.255.255 any
40 deny ip 192.168.0.0 0.0.255.255 any
50 deny ip host 0.0.0.0 any
60 deny ip 224.0.0.0 31.255.255.255 any
70 deny ip 127.0.0.0 0.255.255.255 any
80 deny ip 169.254.0.0 0.0.255.255 any
900 deny ip 192.0.2.0 0.0.0.255 any
100 deny ip 150.1.4.0 0.0.0.255 any
110 permit ip any any
R4#