5.1. Настройка ARP

Назначение

Протокол ARP предназначен для определения MAC-адреса по известному IP-адресу.

Описание

Записи ARP можно добавлять, удалять или изменять вручную. Добавленные вручную записи могут быть временными или постоянными.

Настройка

В примере ниже интерфейсу “eth-0-1” назначен адрес 11.11.11.1/24.

В подсети 11.11.11.0/24 есть два узла, их IP-адреса: 11.11.11.2, 11.11.11.3, MAC-адреса: 0058-3F11-ECA2, 0058-3F11-ECA3.

ARP-запись узла 11.11.11.2 добавляется вручную, запись узла 11.11.11.3 добавляется динамически. Период ожидания записей ARP для интерфейса “eth-0-1” настраивается на 20 минут (1200 секунд), задержка повторной попытки запроса ARP настраивается на 2 секунды.

Сетевая конфигурация приведена на рисунке ниже.

image

Рис. 5.1 Сетевая конфигурация

Шаг 1: Вход в режим “Global config”

Switch# configure terminal

Шаг 2: Настройка порта “eth-0-1”

Switch(config)# interface eth-0-1
Switch(config-if)# no switchport
Switch(config-if)# ip address 11.11.11.1/24

Шаг 3: Настройка периода ожидания записей и задержки повторной попытки запроса

Switch(config-if)# arp timeout 1200
Switch(config-if)# arp retry-interval 2
Switch(config-if)# exit

Шаг 4: Добавление статической записи

Switch(config)# arp 11.11.11.2 001a.a011.eca2

Шаг 5: Выход из режима “Global config”

Switch(config)# end

Шаг 6: Проверка

Switch# show ip arp summary Gratuitous ARP learning is enabled ARP fake global is disabled 3 IP ARP entries, with 0 of them incomplete (Static:1, Dynamic:1, Interface:1) ARP Pkt Received number is: 2 ARP Pkt Send number is: 2 ARP Pkt Discard number is: 0

Switch# show ip arp Protocol Address Age (min) Hardware Addr Interface Internet 11.11.11.1 - 0058.3f1c.fff7 eth-0-1 Internet 11.11.11.2 - 001a.a011.eca2 eth-0-1 Internet 11.11.11.3 0 001a.a011.eca3 eth-0-1

Switch# show interface eth-0-1 Interface eth-0-1 Interface current state: UP Hardware is Ethernet, address is 0058.3f1c.fff7 (bia 0058.3f1c.fff7) Bandwidth 1000000 kbits Index 23 , Metric 1 , Encapsulation ARPA Speed - 1000Mb/s , Duplex - Full , Media type is 1000BASE_T Last up time(UTC): 2024-11-10 19:58:31 Last down time(UTC): 2024-11-10 19:58:29 Current system time(UTC): 2024-11-10 20:05:01 Link type is autonegotiation FEC config: DEFAULT FEC status: OFF Admin input flow-control is off, output flow-control is off Oper input flow-control is off, output flow-control is off The Maximum Frame Size is 9600 bytes VRF binding: not bound VRRP master of : VRRP is not configured on this interface ARP timeout 00:20:00, ARP retry interval 2s ARP Proxy is disabled, Local ARP Proxy is disabled Internet primary address: 11.11.11.1/24 broadcast 11.11.11.255 5 minute input rate 5 bits/sec, 0 packets/sec 5 minute output rate 4 bits/sec, 0 packets/sec 4 packets input, 657 bytes Received 1 unicast, 3 broadcast, 0 multicast 0 runts, 0 giants, 0 input errors, 0 CRC 0 frame, 0 overrun, 0 pause input 3 packets output, 290 bytes Transmitted 2 unicast, 1 broadcast, 0 multicast 0 underruns, 0 output errors, 0 pause output 0 output discard