ip address and dhcp

jamesleecolemanjamesleecoleman Member Posts: 1,899 ■■■■■□□□□□
Hey!!!

I'm confused with assigning ip addresses with interfaces. I know how to assign them to the interface but I don't understand why my computer thats hooked up to the switch doesn't get an ip address. I thought the interface would have given out ip addreses automatically. The only time is when I get an ip address is when I assign a dhcp address in the global config. Then assign an ip address that is the same ip / mask to that interface. That is when I get ip addresses to the computers. Then only one interface assigns ip addresses and the other doesn't. Would I have to make two different pools for both addresses?
Booya!!
WIP : | CISSP [2018] | CISA [2018] | CAPM [2018] | eCPPT [2018] | CRISC [2019] | TORFL (TRKI) B1 | Learning: | Russian | Farsi |
*****You can fail a test a bunch of times but what matters is that if you fail to give up or not*****

Comments

  • captobviouscaptobvious Member Posts: 648
    Hey!!!

    I'm confused with assigning ip addresses with interfaces. I know how to assign them to the interface but I don't understand why my computer thats hooked up to the switch doesn't get an ip address. I thought the interface would have given out ip addreses automatically. The only time is when I get an ip address is when I assign a dhcp address in the global config. Then assign an ip address that is the same ip / mask to that interface. That is when I get ip addresses to the computers. Then only one interface assigns ip addresses and the other doesn't. Would I have to make two different pools for both addresses?
    You're talking about a switch, right? What does a switch do?
  • jamesleecolemanjamesleecoleman Member Posts: 1,899 ■■■■■□□□□□
    You're talking about a switch, right? What does a switch do?

    Oops sorry!! I ment a router.
    Booya!!
    WIP : | CISSP [2018] | CISA [2018] | CAPM [2018] | eCPPT [2018] | CRISC [2019] | TORFL (TRKI) B1 | Learning: | Russian | Farsi |
    *****You can fail a test a bunch of times but what matters is that if you fail to give up or not*****
  • eleguaelegua Member Posts: 282
    Hey!!!

    I'm confused with assigning ip addresses with interfaces. I know how to assign them to the interface but I don't understand why my computer thats hooked up to the switch doesn't get an ip address. I thought the interface would have given out ip addreses automatically. The only time is when I get an ip address is when I assign a dhcp address in the global config. Then assign an ip address that is the same ip / mask to that interface. That is when I get ip addresses to the computers. Then only one interface assigns ip addresses and the other doesn't. Would I have to make two different pools for both addresses?

    Are you running a DHCP on the router?, can you please explain a little bit more?, i'm not getting what you are asking.
  • jamesleecolemanjamesleecoleman Member Posts: 1,899 ■■■■■□□□□□
    Do I have to run dhcp on the router in order for the pcs on my network to get an ip address or can I just configure an ip addres on the interface and then my pcs get an ip address? I thought if I configured an fa interface with an ip address, on a router then it would automatically give out ip addresses.
    Booya!!
    WIP : | CISSP [2018] | CISA [2018] | CAPM [2018] | eCPPT [2018] | CRISC [2019] | TORFL (TRKI) B1 | Learning: | Russian | Farsi |
    *****You can fail a test a bunch of times but what matters is that if you fail to give up or not*****
  • eleguaelegua Member Posts: 282
    Do I have to run dhcp on the router in order for the pcs on my network to get an ip address or can I just configure an ip addres on the interface and then my pcs get an ip address? I thought if I configured an fa interface with an ip address, on a router then it would automatically give out ip addresses.

    Yes, you have to run DHCP in your router;

    This is assuming that you're using a cisco router:
    Router-----Switch-----PC's
    
    If you want that all PCs in your network got an IP you have to run the service in the router unless you are running a DHCP server:

    config mode:
    service dhcp
    
    Then you have to create the pools:

    Ex:
    ip dhcp pool MyNETWORK
       import all
       network 192.168.1.0 255.255.255.0
       default-router 192.168.1.1 
       dns-server  4.2.2.2 
       lease 2
       update arp
    
    If you want to assign static IPs to any PC then try this:
    ip dhcp pool MyPC
       host 192.168.1.5 255.255.255.0
       client-identifier 01XX.XXXX.XXXX.XX
       lease infinite
    
    XX.XXXX.XXXX.XX will be your Mac Address.
    
    If you want to exclude some IPs then try this:
    ip dhcp excluded-address 192.168.1.1 192.168.1.5
    
    If you have this and still your PC's don't get an IP address then try some sh cmds to verify:
    sh ip dhcp binding
    
    This will tell you if your DHCP is assigning IPs

    Hope this help.icon_thumright.gif
  • phoeneousphoeneous Member Posts: 2,333 ■■■■■■■□□□
    I thought if I configured an fa interface with an ip address, on a router then it would automatically give out ip addresses.

    I'm just curious, why did you think that?
Sign In or Register to comment.