04-20-2021 04:26 PM
Hello,
I am trying to configure on a Catalyst 1000 switch a DHCP Server on network 192.168.1.0/24 with a fixed IP address of 192.168.1.10 for a PC Network with a specific MAC address.
Here is the steps I followed :
1) Type commands on Switch
conf t ip dhcp pool 192.168.1.0 network 192.168.1.0 255.255.255.0 default-router 192.168.1.1 exit int vlan 1 ip address pool 192.168.1.0 exit ip dhcp pool PC host 192.168.1.10 hardware-address 01xx.xxxx.xxxx.xx exit do sh ip dhcp pool
2) Check on Switch
Pool 192.168.1.0 : Utilization mark (high/low) : 100 / 0 Subnet size (first/next) : 0 / 0 Total addresses : 254 Leased addresses : 0 Excluded addresses : 1 Pending event : none 1 subnet is currently in the pool : Current index IP address range Leased/Excluded/Total 192.168.1.1 192.168.1.1 - 192.168.1.254 0 / 1 / 254 Pool PC : Utilization mark (high/low) : 100 / 0 Subnet size (first/next) : 0 / 0 Total addresses : 1 Leased addresses : 1 Excluded addresses : 1 Pending event : none 0 subnet is currently in the pool : Current index IP address range Leased/Excluded/Total 192.168.1.10 192.168.1.10 - 192.168.1.10 1 / 1 / 1
3) Type commands on Switch
do clear ip dhcp binding *
4) Type commands on PC
ipconfig /release && ipconfig /renew
No IP delivered
5) Type commands on Switch
do sh interfaces
6) Check
Vlan1 is up, line protocol is up Hardware is EtherSVI, address is XXXX.XXXX.XXXX (bia XXXX.XXXX.XXXX) Internet address will be autoconfigured from local DHCP pool MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive not supported ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:00, output 00:22:34, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo Output queue: 0/40 (size/max) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 0 packets input, 0 bytes, 0 no buffer Received 0 broadcasts (0 IP multicasts) 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 packets output, 0 bytes, 0 underruns 0 output errors, 2 interface resets 1704 unknown protocol drops 0 output buffer failures, 0 output buffers swapped out GigabitEthernet1/0/1 is up, line protocol is up (connected) Hardware is Gigabit Ethernet, address is XXXX.XXXX.XXXX (bia XXXX.XXXX.XXXX) MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Full-duplex, 1000Mb/s, media type is 10/100/1000BaseTX input flow-control is off, output flow-control is unsupported ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:01:18, output 00:00:00, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo Output queue: 0/40 (size/max) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 3000 bits/sec, 3 packets/sec 34620 packets input, 8502653 bytes, 0 no buffer Received 4427 broadcasts (3590 multicasts) 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 watchdog, 3590 multicast, 0 pause input 0 input packets with dribble condition detected 62613 packets output, 37744232 bytes, 0 underruns 0 output errors, 0 collisions, 1 interface resets 0 unknown protocol drops 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier, 0 pause output 0 output buffer failures, 0 output buffers swapped out
7) Type commands on Switch
int gigabitEthernet 1/0/1 shutdown no shutdown exit do sh ip dhcp binding
Bindings from all pools not associated with VRF: IP address Client-ID/ Lease expiration Type State Interface Hardware address/ User name 192.168.1.10 01xx.xxxx.xxxx.xx Infinite Manual Selecting Unknown
9) Type commands on PC
ipconfig /renew
No IP delivered
10) Type commands on Switch
ip dhcp pool 192.168.1.0 network 192.168.1.0 255.255.255.0 default-router 192.168.1.1 address 192.168.1.10 hardware-address 01xx.xxxx.xxxx.xx % Address 192.168.1.10 is not valid in this pool. exit int vlan 1 ip address 192.168.1.2 255.255.255.0 exit
11) Type commands on PC
ipconfig /renew
=> Got 192.168.1.3
12) Type commands on Switch and Check
(config)#do sh ip dhcp binding
Bindings from all pools not associated with VRF: IP address Client-ID/ Lease expiration Type State Interface Hardware address/ User name 192.168.1.1 XXXX.XXXX.XXXX Apr 22 2021 12:57 AM Automatic Active Vlan1 192.168.1.3 01xx.xxxx.xxxx.xx Apr 22 2021 12:58 AM Automatic Active Vlan1 192.168.1.10 01xx.xxxx.xxxx.xx Infinite Manual Selecting Unknown (config)#do sh ip dhcp pool Pool 192.168.1.0 : Utilization mark (high/low) : 100 / 0 Subnet size (first/next) : 0 / 0 Total addresses : 254 Leased addresses : 2 Excluded addresses : 1 Pending event : none 1 subnet is currently in the pool : Current index IP address range Leased/Excluded/Total 192.168.1.4 192.168.1.1 - 192.168.1.254 4 / 3 / 254 Pool PC : Utilization mark (high/low) : 100 / 0 Subnet size (first/next) : 0 / 0 Total addresses : 1 Leased addresses : 1 Excluded addresses : 1 Pending event : none 0 subnet is currently in the pool : Current index IP address range Leased/Excluded/Total 192.168.1.10 192.168.1.10 - 192.168.1.10 1 / 1 / 1
So I have an IP address but not using the one that is matching to the correct fixed pool.
04-21-2021 11:52 PM
Hello
why are you using ip address pool on the switch svi vlan 1 interface?
This needs to be a definitive local ip address not a pool as provided in my previous example.
04-22-2021 04:29 AM
Hello,
Thanks for your help.
I tried :
ip address 192.168.0.4 255.255.255.0
=> No DHCP working anymore on PC
I tried :
ip address 192.168.1.1 255.255.255.0
=> Error conflict
then I tried :
ip address 192.168.1.2 255.255.255.0
=> No DHCP working for PC also
Also :
ip address dhcp
=> DHCP on PC still not working
So the only option left was to put ip pool 192.168.1.0 in vlan 1.
May I missed something?
04-22-2021 05:52 AM - edited 04-22-2021 05:52 AM
Hello
Afer revewing your toplogy, Even is your clients can receive ip allocation from vlan 1 subnet 192.168.1.0/24, they WONT be able to access the internet UNLESS the ISP rtr is aware of the vlan1subnet and it configured to pefrom Network Translation for it as the cisco switch cannot do NAT
So the questions are:
Does the ISP provide dhcp already for subnet 192.168.0.0
Do you have admin righs to add a NAT statment for this vlan 1 subnet 192.168.1.0/24 on the ISP rtr?
04-22-2021 08:30 AM
Yes ISP Router is providing DHCP for 192.168.0.0/24, but because ISP can change so the Router, I want to assign IP by my CISCO Switch.
As I understand, it may be simplier to work with 2 vlans :
- one for ISP port with a fixed IP (or assigned by ISP Router)
- one for other ports with 192.168.1.0/24 network
And do inter-vlan routing group ?
04-23-2021 12:33 AM
Hello
@victorc7 wrote:
Yes ISP Router is providing DHCP for 192.168.0.0/24, but because ISP can change so the Router, I want to assign IP by my CISCO Switch.
As I understand, it may be simplier to work with 2 vlans :
Using two vlans can be achieved however as I have said the switch cannot perform Network Translation so the ISP rtrs NAT would need to be amended and its route table updated (via static route) for the additional vlan on the switch so clients in that vlan to be able to obtain internet connectivity.
Please review attached file:
04-24-2021 04:27 PM
Thanks for your help.
On ISP Router, I have added a route for 192.168.1.0/24 to 192.168.0.4 (IP of G1/0/9 assigned by ISP DHCP, fixed).
For NAT, except if I want to access a Local Server from the Internet, is it really needed?
I did the command, so I am able to ping 192.168.0.2 from G1/0/9 Interface but not from VLAN 10 interface, despite proper Route.
Here is the new config :
Current configuration : 6692 bytes ! ! Last configuration change at 01:11:43 UTC Sun Apr 25 2021 by victorc ! version 15.2 no service pad service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname C1000-8P-E-2G-L ! boot-start-marker boot-end-marker no aaa new-model switch 1 provision c1000-8p-e-2g-l system mtu routing 1500 ip routing ip dhcp excluded-address 192.168.1.1 192.168.1.199 ! ip dhcp pool Netgear-WAX214 host 192.168.1.5 255.255.255.0 client-identifier 01xx.xxxx.xxxx.xx default-router 192.168.1.1 ! ip dhcp pool PC-RJ45 host 192.168.1.10 255.255.255.0 client-identifier 01xx.xxxx.xxxx.xx default-router 192.168.1.1 ! ip dhcp pool PC-Wifi host 192.168.1.11 255.255.255.0 client-identifier 01xx.xxxx.xxxx.xx default-router 192.168.1.1 ! ip dhcp pool 192.168.1.0 network 192.168.1.0 255.255.255.0 dns-server 192.168.1.1 default-router 192.168.1.1 lease 0 8 ! ! ip dhcp snooping vlan 1,1000 ip dhcp snooping ip domain-name domain.com ip name-server 8.8.8.8 ip name-server 8.8.4.4 ip igmp snooping vlan 10 last-member-query-count 2 ip igmp snooping vlan 10 last-member-query-interval 1000 ip igmp snooping vlan 1000 last-member-query-count 2 ip igmp snooping vlan 1000 last-member-query-interval 1000 ! ! spanning-tree mode rapid-pvst spanning-tree extend system-id ! vlan internal allocation policy ascending ! ! ! interface GigabitEthernet1/0/1 description Client ports switchport access vlan 10 switchport mode access spanning-tree portfast edge spanning-tree bpduguard enable ! interface GigabitEthernet1/0/2 description Client ports switchport access vlan 10 switchport mode access spanning-tree portfast edge spanning-tree bpduguard enable ! interface GigabitEthernet1/0/3 description Client ports switchport access vlan 10 switchport mode access spanning-tree portfast edge spanning-tree bpduguard enable ! interface GigabitEthernet1/0/4 description Client ports switchport access vlan 10 switchport mode access spanning-tree portfast edge spanning-tree bpduguard enable ! interface GigabitEthernet1/0/5 description Client ports switchport access vlan 10 switchport mode access spanning-tree portfast edge spanning-tree bpduguard enable ! interface GigabitEthernet1/0/6 description Client ports switchport access vlan 10 switchport mode access spanning-tree portfast edge spanning-tree bpduguard enable ! interface GigabitEthernet1/0/7 description Client ports switchport access vlan 10 switchport mode access spanning-tree portfast edge spanning-tree bpduguard enable ! interface GigabitEthernet1/0/8 description Client ports switchport access vlan 10 switchport mode access spanning-tree portfast edge spanning-tree bpduguard enable ! interface GigabitEthernet1/0/9 description Connection to ISP no switchport ip address dhcp ! interface GigabitEthernet1/0/10 switchport access vlan 1000 switchport mode access ! interface Vlan1 ip address dhcp hostname c1000-8p shutdown ! interface Vlan10 description Client_vlan ip address 192.168.1.1 255.255.255.0 ! ip http server ip http banner ip http authentication local ip http secure-server ip http session-idle-timeout 300 ip route 0.0.0.0 0.0.0.0 GigabitEthernet1/0/9 dhcp ! ! ! ! line con 0 line vty 0 4 login local transport input all transport output all line vty 5 10 login local transport input all transport output all line vty 11 15 login transport input none ! end
Thanks
PS : dns-server seems not to be existing
04-25-2021 01:15 AM - edited 04-25-2021 01:15 AM
Hello
@victorc7 wrote:
I did the command, so I am able to ping 192.168.0.2 from G1/0/9 Interface but not from VLAN 10 interface,
Is vlan 10 interface up?
sh ip int brief
@victorc7 wrote:
On ISP Router, I have added a route for 192.168.1.0/24 to 192.168.0.4 (IP of G1/0/9 assigned by ISP DHCP, fixed).
For NAT, except if I want to access a Local Server from the Internet, is it really needed?
If you wish to access to a specific server from the internet then you need to create a static nat statement for that on your ISP rtr.
@victorc7 wrote:
PS : dns-server seems not to be existing
So in your dhcp pool remove the dns-server and apply the import all option
example:
ip dhcp pool 192.168.1.0
no dns-server 192.168.1.1
import all
04-25-2021 01:21 AM
C1000-8P-E-2G-L#sh ip int brief Interface IP-Address OK? Method Status Protocol Vlan1 unassigned YES NVRAM administratively down down Vlan10 192.168.1.1 YES NVRAM up up GigabitEthernet1/0/1 unassigned YES unset up up GigabitEthernet1/0/2 unassigned YES unset up up GigabitEthernet1/0/3 unassigned YES unset up up GigabitEthernet1/0/4 unassigned YES unset down down GigabitEthernet1/0/5 unassigned YES unset down down GigabitEthernet1/0/6 unassigned YES unset down down GigabitEthernet1/0/7 unassigned YES unset down down GigabitEthernet1/0/8 unassigned YES unset down down GigabitEthernet1/0/9 192.168.0.4 YES DHCP up up GigabitEthernet1/0/10 unassigned YES unset down down
Here is the ping after removing dns-server :
C1000-8P-E-2G-L#ping ip 192.168.0.2 source gigabitEthernet 1/0/9 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.0.2, timeout is 2 seconds: Packet sent with a source address of 192.168.0.4 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/3 ms C1000-8P-E-2G-L#ping ip 192.168.0.2 source vlan 10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.0.2, timeout is 2 seconds: Packet sent with a source address of 192.168.1.1 ..... Success rate is 0 percent (0/5)
04-25-2021 01:54 AM - edited 04-25-2021 01:54 AM
Hello
FYI -Removing the dns-server from the dhcp scope wont rectify a failing icmp sourced from vlan 10, Can you verify your static route on the ISP rtr for 192.168.1.0/24?
04-25-2021 02:15 AM
Hello,
Sure, here is the config on ISP Router :
Thanks
04-25-2021 02:34 AM - edited 04-25-2021 02:36 AM
Hello
So it does look like the rtr has a route for 192.168.10/24 towards the switch however icmp is failing
Can you please make the following changes in theory it shouldn't make any difference but i am wondering if the switch for some reason doesn't like having a routed port, Just make sure the switch obtains the same ip address if it doesn't then you would need to update the static route on the ISP
switch
conf t
default interface gig1/0/9
interface gig1/0/9
shut
switchport mode access
spanning-tree portfast edge
no shut
int vlan 1
ip address dhcp
no shut
no ip route 0.0.0.0 0.0.0.0 GigabitEthernet1/0/9 dhcp
ip route 0.0.0.0 0.0.0.0 vlan 1 dhcp
04-25-2021 03:37 AM
With this new config, Switch is not able to get IP from ISP DHCP.
C1000-8P-E-2G-L#sh ip int brief Interface IP-Address OK? Method Status Protocol Vlan1 unassigned YES DHCP up up Vlan10 192.168.1.1 YES NVRAM up up GigabitEthernet1/0/1 unassigned YES unset up up GigabitEthernet1/0/2 unassigned YES unset up up GigabitEthernet1/0/3 unassigned YES unset up up GigabitEthernet1/0/4 unassigned YES unset down down GigabitEthernet1/0/5 unassigned YES unset down down GigabitEthernet1/0/6 unassigned YES unset down down GigabitEthernet1/0/7 unassigned YES unset down down GigabitEthernet1/0/8 unassigned YES unset down down GigabitEthernet1/0/9 unassigned YES unset up up GigabitEthernet1/0/10 unassigned YES unset down down C1000-8P-E-2G-L#sh vl C1000-8P-E-2G-L#sh vlan VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Gi1/0/9 10 Client_vlan active Gi1/0/1, Gi1/0/2, Gi1/0/3 Gi1/0/4, Gi1/0/5, Gi1/0/6 Gi1/0/7, Gi1/0/8 1002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 10 enet 100010 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 Primary Secondary Type Ports ------- --------- ----------------- ------------------------------------------ C1000-8P-E-2G-L#sh ip rou C1000-8P-E-2G-L#sh ip route Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR Gateway of last resort is not set 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.1.0/24 is directly connected, Vlan10 L 192.168.1.1/32 is directly connected, Vlan10
Here is extract of running config.
interface GigabitEthernet1/0/1 description Client ports switchport access vlan 10 switchport mode access spanning-tree portfast edge spanning-tree bpduguard enable ! interface GigabitEthernet1/0/9 switchport mode access spanning-tree portfast edge ! interface Vlan1 ip address dhcp ! interface Vlan10 description Client_vlan ip address 192.168.1.1 255.255.255.0 ! ip http server ip http banner ip http authentication local ip http secure-server ip http session-idle-timeout 300 ip route 0.0.0.0 0.0.0.0 Vlan1 dhcp ! !
PS : I had to save / reload in order to remove old route.
I tried also reload after this new config.
04-25-2021 04:57 AM
Hello
Do you have dhcp snooping enabled, if so make sure the physical port that connects to the rtr is trusted
04-25-2021 05:44 AM
C1000-8P-E-2G-L(config)#do sh ip route Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR Gateway of last resort is 192.168.0.2 to network 0.0.0.0 S* 0.0.0.0/0 [0/0] via 192.168.0.2 192.168.0.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.0.0/24 is directly connected, Vlan1 L 192.168.0.4/32 is directly connected, Vlan1 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.1.0/24 is directly connected, Vlan10 L 192.168.1.1/32 is directly connected, Vlan10
04-25-2021 05:40 AM
Hello,
Yes it works better to get an IP with G1/0/9 snooping trusted
How ever, still not able to communicate :
C1000-8P-E-2G-L(config)#do sh ip int brief Interface IP-Address OK? Method Status Protocol Vlan1 192.168.0.4 YES DHCP up up Vlan10 192.168.1.1 YES NVRAM up up GigabitEthernet1/0/1 unassigned YES unset up up GigabitEthernet1/0/2 unassigned YES unset up up GigabitEthernet1/0/3 unassigned YES unset up up GigabitEthernet1/0/4 unassigned YES unset down down GigabitEthernet1/0/5 unassigned YES unset down down GigabitEthernet1/0/6 unassigned YES unset down down GigabitEthernet1/0/7 unassigned YES unset down down GigabitEthernet1/0/8 unassigned YES unset down down GigabitEthernet1/0/9 unassigned YES unset up up GigabitEthernet1/0/10 unassigned YES unset down down C1000-8P-E-2G-L(config)#do ping ip 192.168.0.2 source vlan 1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.0.2, timeout is 2 seconds: Packet sent with a source address of 192.168.0.4 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/3 ms C1000-8P-E-2G-L(config)#do ping ip 192.168.0.2 source vlan 10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.0.2, timeout is 2 seconds: Packet sent with a source address of 192.168.1.1 ..... Success rate is 0 percent (0/5) C1000-8P-E-2G-L(config)#do ping ip 8.8.8.8 source vlan 1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds: Packet sent with a source address of 192.168.0.4 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 11/11/13 ms C1000-8P-E-2G-L(config)#do ping ip 8.8.8.8 source vlan 10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds: Packet sent with a source address of 192.168.1.1 ..... Success rate is 0 percent (0/5)
Regards
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide