Перейти к содержимому

Dhcp failed apipa is being used cisco ошибка как исправить

  • автор:

Настройка cisco dhcp в локальной сети

cisco dhcp

Настройка серверов windows и linux

Всем привет ранее мы закончили настраивать сеть для филиалов, и разобрались со статической маршрутизацией, но все это время настраивали компьютерам ip адреса в ручную. Для решения это задачи есть служба DHCP. Можно конечно использовать Windows DHCP, при наличии лицензии на Windows Server, но Cisco тоже умеет это делать на ура. Настроим давайте DHCP службу на Cisco, рассмотрим несколько вариантов.

Принцип работы DHCP

Как работает dhcp сервер, ответ на этот вопрос очень простой. Когда компьютер появляется в локальной сети, первым делом он отсылает в сеть широковещательный запрос, по всем кто в сети. Данный пакет называется DHCPDISCOVER, в котором он спрашивает ребята есть у вас тут DHCP, если да то дай как мне ip адрес. Если HDCP сервер в локальной сети есть, то он отвечает ему пакетом DHCPOFFER, в котором говорит вот я есть, вот тебе ip адрес, будешь брать? Компьютер получив пакет DHCPOFFER, отсылаем ему ответ в виде пакета DHCPREQUEST в котором говорит, отлично я беру это ip адрес запиши его за мной, на что DHCP получив этот пакет, отвечает пакетом DHCPACK в котором говорит что записал, что это ip адрес теперь твой. Вот весь принцип.

Принцип работы DHCP

В своей практике я встречал еще вот такие пакеты от dhcp сервера:

  • DHCPDECLINE — это пакет в котором клиент определил, что ip адрес, от DHCP сервера в момент предложения, уже используется кем то, и тогда будет сгенерирован новый запрос на другой ip адрес
  • DHCPRELEASE — данный пакет появляется когда клиент освобождает IP адрес
  • DHCPRENEW — Это пакет содержит в себе запрос на обновление и продление аренды ip адреса
  • DHCPINFORM — пакет, направленный клиентом к серверу DHCP, чтобы получить от него детальную информацию, пример, где находится запасной DHCP сервер в сети

Настройка dhcp cisco

Настройка для маленького офиса

У нас есть филиал, 3 компьютера, один коммутатор второго уровня Cisco 2960 и роутер Cisco 1841. Все компьютеры находятся в нативном vlan (vlan по умолчанию). Вот схема сети.

Настройка для маленького офиса

Приступаем к настройке Cisco 1841. Поднимем у него порт fa0/0 и назначим ему ip 192.168.1.1/24

enable
conf t
in fa0/0
no shutdown
ip address 192.168.1.1 255.255.255.0
exit

настройка cisco 1841

Видим, что порт загорелся зеленым.

поднять порт cisco 1841

Далее создаем pool ip адресов на cisco dhcp server, для этого вводим команду: DHCP_192.168.1.0 это имя

ip dhcp pool DHCP_192.168.1.0

Посмотрим теперь доступные команды

Router(dhcp-config)#?
default-router Default routers
dns-server Set name server
exit Exit from DHCP pool configuration mode
network Network number and mask
no Negate a command or set its defaults
option Raw DHCP options

cisco dhcp server

Задаем в начале сеть которую будем раздавать, естественно она должна быть в том же диапазоне что и ip адрес устройства Cisco. Создаю сеть 192.168.1.0

DHCP Failed APIPA Is Being Used: how to fixed in seconds

Robot Powered Home

I have a batch script that I run every once in a while that reconfigures my computer’s connection with the router.

I made this script so that I don’t have to type in the commands or remember them whenever needed.

I ran the batch file a few days back like I usually do, but when I executed it, the Command Prompt window notified me of an error that said, “DHCP Failed, APIPA is being used.”

I don’t use a static IP and have DHCP on, which would mean that there was some issue with my router’s configuration.

I went online and checked out a few networking forums and my router’s support documentation to find out more.

I managed to find a load of fixes, some easy and some pretty advanced, so I sat down in front of my computer to troubleshoot.

Thanks to several hours of research, I was able to fix my router, and my script ran successfully.

This article summarizes my findings and should help fix your network when you get a DHCP failed error in seconds.

The DHCP Failed APIPA is being used message means that DHCP is currently not working, and the device has defaulted to using APIPA to assign IP addresses. Either use a static IP or turn DHCP on to fix this issue.

Find out in the article what APIPA is and how IP addresses are assigned to devices on your local network and the internet.

Use A Static IP

DHCP is the protocol that issues IP addresses to the devices on your network after a set time or whenever a network change occurs, like a restart or a reset.

If you want to use a Static IP for the devices on your network, you’ll have DHCP turned off.

So after turning DHCP off, assign the Static IPs that the devices connecting to your network can use.

If these aren’t provided, the router cannot establish the connection within the network, which can cause the error you’re seeing now.

After assigning the Static IPs, check if the error comes back again at where you saw it for the time.

Turn DHCP On

Your router defaults to using APIPA or Automatic IP Addressing when it can’t access the DHCP server.

Turning off DHCP in your router settings will block the router from connecting to the DHCP server, and it defaults to using APIPA.

You can turn DHCP on from your Windows PC and your router.

Consult your router’s manual to find out how you can turn DHCP on with its admin interface.

To turn DHCP on Windows:

  1. Open Settings.
  2. Go to Network & Internet.
  3. For Wi-Fi, select Wi-Fi, then Manage known networks. Select the router that you want to turn DHCP on.
  4. For ethernet, click Ethernet, then the network you’re connected to.
  5. Click Edit, under IP Assignment.
  6. Under Edit Network Settings, click. Automatic (DHCP).
  7. Hit Save.

After you turn DHCP on, see if the error comes up again.

You can experiment with keeping DHCP on either your PC or your router if enabling both doesn’t seem to fix the error.

Update Router Firmware

DHCP and other configuration settings are purely software and used to manage the connections to the router, which makes it easier for you or network admins who monitor the network.

If your router’s firmware is outdated or hasn’t been updated in a while, bugs can creep up that might haven’t appeared if you kept its software updated.

The only part of the router that you can update is the firmware, which requires you to log in to your router’s admin interface.

Follow these steps to install the latest firmware on your router:

  1. Go to the support website of your router.
  2. Look for firmware updates for your exact model. You can also go to the community forums to do this.
  3. Download the file and extract the file’s contents into somewhere you remember.
  4. Open a new web browser tab.
  5. Type 192.168.1.1 in the address bar and hit enter.
  6. Log in to the tool with your username and password. If you haven’t set one, check underneath the router. The password would be on a sticker.
  7. Go to Administration or Advanced, or use the search function to find the update page if the tool has it. Consult the manual of your router for the exact location.
  8. Upload the file you had extracted before.
  9. Install the new firmware.
  10. The router will restart and be ready for use when it turns back on.

See if you get the error message again after installing the update to the router’s firmware.

Restart Router

When even a software update fails to fix the issue, its time to take out the most helpful tool in any troubleshooter’s arsenal, the device restart.

Restarts enjoy high success rates because you are soft resetting the device, mainly if you power cycle the device during the restart.

Soft resets don’t affect your settings or other configurations, but they fix many issues because it clears the device’s onboard memory.

To restart or power cycle your router:

  1. Turn the router off.
  2. Unplug it from the wall outlet.
  3. Wait for a minimum of 1 minute before you connect the device back to power.
  4. Turn the router back on.

When the router turns on, check where you saw the error the first time and see if it repeats after the restart.

Reset Router

A restart isn’t the be-all-end-all of troubleshooting, though; we still have the nuclear option left, which is the factory reset.

I call this nuclear because it wipes everything from the router, including your custom settings, the funny name that your Wi-Fi has, and the password you use to connect to it.

Don’t worry; you still can access the router after the reset; you just have to set everything up again like it was before the reset.

To reset your router:

  1. Locate the reset button on the back of the router. It should be recessed and labeled Reset.
  2. Use a pointed non-metallic object to press and hold the button for 30 seconds.
  3. The router will restart when the button is held for the right amount of time.
  4. Let go of the button to allow the router to restart.
  5. When all lights come back on, the reset has been completed.

After the reset, check if the DHCP error appears again.

Contact Support

If none of these troubleshooting tips work, you’ll need to contact your router’s support team.

If you’ve leased the router from your ISP, contact them instead, and they’ll take you through a set of possible fixes to the issue you’re having.

They might schedule an appointment with a technician if they can’t fix the issue over the phone.

For third-party routers, you do have a choice to send them back to the manufacturer for a replacement if its under warranty.

You May Also Enjoy Reading

  • Your ISP’s DHCP Does Not Function Properly: How To Fix
  • How to Change DNS Settings on Xfinity Router
  • 20/40 MHz Coexistence On Netgear Router: What Does This Mean?
  • Not Getting Full Internet Speed Through Router: How to Fix
  • Best Place to Put the Router in a 2-Story House

Frequently Asked Questions

What does APIPA is being used mean?

APIPA or Automatic IP Addressing is the alternate mode of allocating IP addresses to the devices on a network if DHCP is disabled.

Windows and some routers default to this protocol if DHCP was disabled and you set no static IP.

What happens when DHCP fails?

The effects of your DHCP server failing won’t become apparent immediately but will come up when your device asks for a new IP when the previous one times out or if there is a network change.

You can lose your internet connection if your DHCP server fails.

How do I enable DHCP?

You can enable DHCP from Windows network settings or your router’s admin tool.

Consult your router’s manual to know how to enable DHCP on it.

Is DHCP good for gaming?

Gaming on the internet relies on your ISP giving you an IP with their DHCP server, so you’ll be having it on anyway.

But if you’re playing on LAN, having static IPs are always preferred because IP addresses aren’t changing all the time.

RobotPoweredHome.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. © 2024 Robot Powered Home | Privacy Policy

Dhcp failed apipa is being used cisco ошибка как исправить

Всем привет. После написания статьи «Конфигурация DHCP сервера на маршрутизаторах фирмы Cisco» уже двое людей поинтересовались о том, а как же быть если у нас на одном физическом интерфейсе маршрутизатора создано несколько субинтерфейсов, смотрящих в разные vlan ы, и нам требуется раздавать по DHCP разные пулы в разные vlan ы. Сегодня мы разберем вместе с Вами именно этот вопрос.

Как всегда все очень и очень просто. Для начала соберем в Packet Tracer схему приведенную в статье «Маршрутизациямежду vlan — маршрутизатор на привязи». Первоначальные настройки коммутатора и маршрутизатора, такие же как в этой статье. Единственное отличие будет заключаться в конфигурации хостов, в их настройках мы ставим получать конфигурацию по DHCP .

Выставляем в настройках хоста получение конфигурации по DHCP
Выставляем в настройках хоста получение конфигурации по DHCP
Выставляем в настройках хоста получение конфигурации по DHCP
Выставляем в настройках хоста получение конфигурации по DHCP (Продолжение)

Естественно сразу после того как мы это сделали никаких IP адресов они не получат, так как мы еще не настраивали DHCP сервер на маршрутизаторе. Давайте этим и займемся. Для этого выполним на маршрутизаторе следующие команды:

Router(config)#ip dhcp pool Pool_for_vlan_2
Router(dhcp-config)#network 192.168.1.0 255.255.255.0
Router(dhcp-config)#default-router 192.168.1.1
Router(dhcp-config)#dns-server 8.8.8.8
Router(dhcp-config)#exit
Router(config)#ip dhcp pool Pool_for_vlan_3
Router(dhcp-config)#network 10.0.0.0 255.0.0.0
Router(dhcp-config)#default-router 10.10.10.1
Router(dhcp-config)#dns-server 8.8.8.8
Router(dhcp-config)#exit

Я думаю читавшим предыдущие статьи по настройки DHCP все уже стало понятно. Первыми пятью командами мы создаем первый DHCP пул для vlan 2. Вторыми пятью DHCP пул для vlan 3. Маршрутизатор, основываясь на данных указанных в командах network и default — router , будет определять принадлежность конкретного пула к конкретному субинтерфейсу, и, как следствие, каждый из пулов будет раздаваться только в конкретный vlan . Давайте проверим данную конфигурацию. Перейдем на компьютер PC 0 и выполним на нем команду ipconfig / renew , которая запросит у маршрутизатора новые настройки DHCP . Если все сделано верно он должен получить IP адрес 192.168.1.2.

Выполнение ipconfig /renew на PC0
Выполнение ipconfig /renew на PC0

Далее выполняем аналогичные действия на PC 1, если все сделано верно он должен получить IP адрес 10.0.0.1. Теперь проверим работу маршрутизации. Как мы это делали видно из скриншотов.

Проверка работы муршрутизации с PC0
Проверка работы муршрутизации с PC0
Проверка работы маршрутизации с PC1
Проверка работы маршрутизации с PC1

Ну и на последок чтобы окончательно удостовериться в нашей правоте добавим в схему еще один хост PC 2 и подключим его к интерфейсу fastEthernet 0/3 коммутатору. Выставим в его настройках чтобы он также как и остальные хосты получал настройки по DHCP . По умолчанию данный хост находится в vlan 1 и естественно не получает никаких настроек даже если мы на нем выполним ipconfig / renew . Чтобы это исправить, давайте для начала, закинем его в vlan 2. Для этого выполним команды:

Switch(config)#interface fastEthernet 0/ 3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 2
После чего перейдем на хост PC 2 и выполним команду ipconfig / renew .

Компьютер PC2 получил IP адрес из пула для vlan 2
Компьютер PC2 получил IP адрес из пула для vlan 2

Как можно заметить компьютер получил следующий по порядку IP адрес из пула для vlan 2. Теперь давайте перекинем данный хост в vlan 3 и посмотрим что с ним станет, для этого выполним команды:

Switch(config)#interface fastEthernet 0/3
Switch(config-if)#switchport access vlan 3
После чего опять выполним на хосте PC 2 ipconfig / renew .

Компьютер PC2 получил IP адрес из пула для vlan 3
Компьютер PC2 получил IP адрес из пула для vlan 3

Как можно заметить хост получил IP адрес из пула для vlan 3. Что нам и требовалось.
Надеюсь я ответил на Ваш вопрос =)

Хотелось бы выразить огромную благодарность мои друзьям, замечательной семье Гостюниных, которые заставили меня вновь писать статьи в блог!

DHCP failed, APIPA is being used

Primeiramente, peço desculpas pelo atraso no retorno.

Tenho em mente algumas questões que podem estar contribuindo para a existência desse problema:

1) Falta de uma configuração do default-router no dhcp pooll ALURA ;

2) Falta da configuração de um IP na fastEthernet 0/0 do roteador;

3) Assíncronia dos IPs de defalt-router e fastEthernet 0/0.

Vamos revisar cada uma das opções:

Para configurar o default-router no dhcp pooll ALURA, basta seguir os seguintes códigos no terminal de comandos do roteador:

Para acessar as configurações do terminal:

enable configure terminal

Acesse o dhcp pool ALURA:

ip dhcp pool ALURA
default-router 192.168.0.1

Agora vamos configurar o IP da entrada fastEthernet 0/0:

Saia das configurações do dhcp:

exit

Acesse as configurações do fastEthernet 0/0:

interface fastEthernet 0/0
ip address 192.168.0.1

Perceba que os IPs são iguais, isso já resolve a questão da assíncronia.

Caso o problema persista, gostaria de pedir para você compartilhar uma imagem ou as informações das configurações gerais do roteador, dessa forma posso entender melhor o contexto e, juntos, vamos encontrar uma solução.

Acesse as informações gerais do roteador acessando o terminal do roteador em sua forma inicial e use os códigos:

enable
show running-config

Para tirar um print da tela e postar aqui no fórum, basta segir esses passos:

1) Fazer o print da tela do seu computador e salvar a imagem;

  • Tutorial rápido de como tirar um print e salvar a imagem:https://www.bringit.com.br/blog/dicas-e-tutoriais-para-notebook/como-tirar-print-no-notebook-confira-o-passo-a-passo/

2) Voltar ao fórum e fazer o upload da imagem clicando no ícone definido como Upload de Imagem. Inserir o print e publicar.

Barra de opções aqui do fórum, ressaltando o botão de 'Upload de imagem'

Espero ter ajudado! Quaisquer dúvidas, estou à disposição. ��

Caso este post tenha lhe ajudado, por favor, marcar como solucionado ✓.Bons Estudos!

Confira mais conteúdo com nossos artigos sobre DevOps. Conheça nossos cursos de DevOps.

Assista as primeiras aulas sobre sobre Redes parte 1: conceitos e prática.

  • Sobre a Alura
  • Dúvidas frequentes
  • Sugira um curso
  • Sugira uma funcionalidade
  • Blog da Alura

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *