20 déc. 2021

NTP - ACL

NTP - Network Time Protocol

Packet types:

Control messages : don't bother with this.
NTP request/update messages: used for time synchrnonization


You can define ACL to protect your infrastructure:

Cisco defines 4 Access Control :

- Peer: 

    The router responds to NTP Request, Accepts NTP Updates and NTP Control Queries.

    This is where you filter from where you want to sync ! 

- Serve: 

    The router reponds to NTP Request, Accepts NTP Control Queries.

- Serve-only:

    The router responds to NTP Requests Only. 

    Won't synchronize local system time.

- Query-only: 

    The router only accepts NTP control queries. 

    No response to NTP requests are sent, no local system time synchronization with remote system is permitted.


So basically, 

- If you want your router to only synchronize to NTP Servers :

    - Peer ACL is configured with the IP Address of the NTP Servers.

    - Server, Serve-only and Query-only ACLs are denying everything.

That is:

!

access-list 1 remark utility ACL to block everything

access-list 1 deny any

!

access-list 10 remark NTP peers/servers we sync to/with

access-list 10 permit 185.156.175.251

access-list 10 permit 80.67.184.4

access-list 10 permit 134.59.1.5

access-list 10 deny any

!

ntp access-group query-only 1   ! deny all NTP control queries

ntp access-group serve 1        ! deny all NTP time and control queries by default

ntp access-group peer 10        ! permit time sync to configured peer(s)/server(s) only

ntp access-group serve-only 1 ! deny NTP time sync requests from potential clients

!



- If you want to router to synchronize to NTP Servers and be an NTP Server:

    - Peer ACL is configured with the IP Address of the NTP Servers.

    - Serve-only ACL is configured with the IP Address of your clients.

    - Server and Query-only ACLs are denying everything.


That is:

!

access-list 1 remark utility ACL to block everything

access-list 1 deny any

!

access-list 10 remark NTP peers/servers we sync to/with

access-list 10 permit 185.156.175.251

access-list 10 permit 80.67.184.4

access-list 10 permit 134.59.1.5

access-list 10 deny any

!

access-list 20 remark Hosts/Networks we allow to get time from us

access-list 20 permit 192.168.0.0 0.0.0.255

!

ntp access-group query-only 1   ! deny all NTP control queries

ntp access-group serve 1        ! deny all NTP time and control queries by default

ntp access-group peer 10        ! permit time sync to configured peer(s)/server(s) only

ntp access-group serve-only 20  ! permit NTP time sync requests from a select set of clients

!

ntp server ip ntp.deuza.net minpoll 10

ntp server ip ntp.midway.ovh minpoll 10

ntp server ip ntp.unice.fr minpoll 10 prefer source Vlan1


IOS router may associate an access-list with any of the above access-types, classifying NTP message sources by their types. Two rules are observed by IOS when an incoming NTP packet is matched against configured types of access:

1) All access-groups associated with access types are scanned in the ordrer presented above (from 1 to 4) – that is, following from most permissive to most restrictive. The first match is used to determine the message source access type.
2) If any of the access types has been defined with an ACL, all other access types are implicitly denied. Just by restricting some sources, you may effectively block all others as well

Now here is a catch. If your router is configured as NTP master, and you set up any access-control group, you must allow “peer” access type to a source with IP address “127.127.7.1”. This is because “127.127.7.1” is the internal server created by ntp master command, which the local router synchronizes to. If you forget to enable it peer access, your server will always be out of sync. Here are some examples. First one: configure R1 as NTP master and allow the server to be polled for NTP updates just by one client. Client should receive updates just from one source:




30 sept. 2021

ENCOR - PART 1 – NETWORK INFRASTRUCTURE

Switched Campus

Switch Administration

Managing MAC address Table

MAC Address Table and VLANs

All MAC Addresses are associated with a VLAN and an address can exist in more than one VLAN.

Each VLAN maintains its own logical address table.

When private VLANs are configured, address learning depends on the type of MAC address:

-        Dynamic MAC addresses learned in one VLAN of a private VLAN are replicated in the associated VLANs.

-        Static MAC addresses configured in a primary or secondary VLAN are not replicated in the associated VLANs. When you configure a static MAC address in a private VLAN primary or secondary VLAN, you should also configure the same static MAC address in all associated VLANs.


Feature:

Default Settings:

Aging Time

300 seconds or 5 minutes

Dynamic Address

Automatically Learned

Static Address

None configured


Commands:

mac address-table aging-time [ 0 | 10-1000000 ] [ vlan vlan-id ]

show mac address-table aging-time


Remove Dynamic MAC Address Entries


 

Remove Dynamic MAC Address Entries

 

clear mac address-table dynamic

clear mac address-table dynamic address mac-address

clear mac address-table dynamic interface interface-id

clear mac address-table dynamic vlan vlan-id

 

MAC Address Change Notification Traps

 

MAC address change notification tracks users on a network by storing the MAC address change activity.

When the switch learns or removes a MAC address, an SNMP notification trap can be sent. 

 

Commands:

 

snmp-server enable traps mac-notification change

mac address-table notification change

mac address-table notification change [ interval value ] [ history-size value ]

 

Then, you configure per interface: 

interface GigabitEthernet0/1

 snmp trap mac-notification change { added | removed }

 

Below shows how to specify 172.20.10.10 as the NMS, enable the switch to send MAC address notification traps to the NMS, enable the MAC address-change notification feature, set the interval time to 123 seconds, set the history-size to 100 entries, and enable traps whenever a MAC address is added on the specified port.

Switch(config)# snmp-server host 172.20.10.10 traps private mac-notification 

Switch(config)# snmp-server enable traps mac-notification change 

Switch(config)# mac address-table notification change 

Switch(config)# mac address-table notification change interval 123 

Switch(config)# mac address-table notification change history-size 100 

Switch(config)# interface gigabitethernet1/0/2 

Switch(config-if)# snmp trap mac-notification change added 

 




















NTP - ACL

NTP - Network Time Protocol Packet types: -  Control messages : don't bother with this. -  NTP request/update messages: used for time sy...