Advanced Network Services: DHCP, NTP & FHRP

CCIE Enterprise Infrastructure EVE-NG / GNS3

مقصدObjectiveObjective

اس سبق کے بعد آپ DHCP pools/options/relay، NTP authentication، اور HSRP/VRRP/GLBP failover configure کر سکیں گے۔Is lesson ke baad aap DHCP pools/options/relay, NTP authentication, aur HSRP/VRRP/GLBP failover configure kar sakenge.After this lesson you will be able to configure DHCP pools/options/relay, NTP authentication, and HSRP/VRRP/GLBP failover.

آسان مثالSimple AnalogySimple Analogy

Network services ایسی ہیں جیسے عمارت کی بنیادی سہولتیں — DHCP استقبالیہ ہے جو دفاتر الاٹ کرتا ہے، NTP عمارت کی گھڑی، FHRP backup دروازہ۔ کوئی خاص چیز نہیں، لیکن ان کے بغیر عمارت بند ہو جاتی ہے۔Network services aisi hain jaise building ki bunyadi saholaten — DHCP reception hai jo offices allot karta hai, NTP building ki ghari, FHRP backup darwaza. Koi khaas cheez nahi, lekin in ke baghair building band ho jati hai.Network services are like building utilities — DHCP is the reception desk assigning offices, NTP is the building clock, FHRP is the backup entrance. Nothing fancy, but without them the building stops working.

سیٹ اپLab SetupLab Setup

دو روٹرز (R1، R2) لیں جو gateway + DHCP/NTP سرور ہوں، ایک client روٹر۔ درمیان میں ایک switch۔ اگر PC image ہو تو استعمال کریں۔Do routers (R1, R2) lein jo gateway + DHCP/NTP server hon, ek client router. Darmiyan mein ek switch. Agar PC image ho to use karein.Use two routers (R1, R2) acting as gateway + DHCP/NTP servers, one client router. One switch between them. Test with a PC image if available.

اقداماتStepsSteps

Step 1

DHCP pool بنائیں۔ Option 66 TFTP سرور کی طرف اشارہ کرتا ہے (VoIP phones کے لیے مفید)؛ lease مدت طے کرتی ہے۔DHCP pool banayein. Option 66 TFTP server ki taraf ishara karta hai (VoIP phones ke liye mufeed); lease muddat tay karti hai.Create the DHCP pool. Option 66 points to a TFTP server (useful for VoIP phones); lease defines the holding time.

ip dhcp pool CLIENTS
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
dns-server 8.8.8.8
option 66 ascii 10.1.1.1
lease 0 8

Step 2

Static IPs (gateway، servers) کو ہمیشہ pool سے exclude کریں۔ Bindings اور statistics verify کریں۔Static IPs (gateway, servers) ko hamesha pool se exclude karein. Bindings aur statistics verify karein.Always exclude static IPs (gateway, servers) from the pool. Verify bindings and statistics.

ip dhcp excluded-address 192.168.10.1 192.168.10.10
show ip dhcp binding
show ip dhcp server statistics

Step 3

DHCP relay: اگر سرور دوسرے subnet میں ہو تو client VLAN interface پر helper-address لگائیں تاکہ broadcast آگے پہنچے۔DHCP relay: agar server doosre subnet mein ho to client VLAN interface par helper-address lagayein taake broadcast aage pohonche.DHCP relay: if the server lives in another subnet, use helper-address on the client VLAN interface to forward broadcasts.

interface GigabitEthernet0/0
ip helper-address 10.1.1.100

Step 4

NTP کو MD5 authentication سے محفوظ کریں — logs، certificates اور troubleshooting سب درست وقت پر منحصر ہیں۔NTP ko MD5 authentication se mehfooz karein — logs, certificates aur troubleshooting sab durust waqt par munhasir hain.Secure NTP with MD5 authentication — logs, certificates and troubleshooting all depend on accurate time.

ntp authenticate
ntp authentication-key 1 md5 Cisco123
ntp trusted-key 1
ntp server 10.1.1.10 key 1
show ntp status

Step 5

HSRP configure کریں۔ زیادہ priority والا روٹر active بنتا ہے؛ preempt recovery کے بعد role واپس دلاتا ہے۔ Tracking uplink fail ہونے پر priority کم کرتی ہے۔HSRP configure karein. Zyada priority wala router active banta hai; preempt recovery ke baad role wapas dilata hai. Tracking uplink fail hone par priority kam karti hai.Configure HSRP. The higher priority router becomes active; preempt lets it reclaim the role after recovery. Tracking drops priority when the uplink fails.

interface GigabitEthernet0/0
standby 10 ip 192.168.10.1
standby 10 priority 110
standby 10 preempt
standby 10 track 1 decrement 20

Step 6

VRRP open-standard مقابل ہے؛ GLBP دونوں gateways پر load balance کرتا ہے (active-active)۔ Active روٹر کا لنک بند کر کے failover ٹیسٹ کریں۔VRRP open-standard muqabil hai; GLBP dono gateways par load balance karta hai (active-active). Active router ka link band kar ke failover test karein.VRRP is the open-standard equivalent; GLBP load-balances across both gateways (active-active). Test by shutting the active router's link.

interface GigabitEthernet0/0
vrrp 10 ip 192.168.10.1
vrrp 10 priority 110
vrrp 10 preempt
glbp 10 ip 192.168.10.1
glbp 10 priority 110
glbp 10 preempt
glbp 10 load-balancing round-robin

تصدیقVerifyVerify

یقین کریں کہ DHCP bindings موجود ہیں، client کو options مل رہے ہیں، NTP synchronized (authenticated) ہے، HSRP active/standby حالت میں ہے، اور active روٹر کا uplink بند کرنے پر failover کامیاب ہوتا ہے۔Yaqeen karein ke DHCP bindings maujood hain, client ko options mil rahe hain, NTP synchronized (authenticated) hai, HSRP active/standby state mein hai, aur active router ka uplink band karne par failover kamyab hota hai.Confirm DHCP bindings exist, the client gets options, NTP is synchronized (authenticated), HSRP state is active/standby, and failover works when the active router's uplink is shut.

show ip dhcp binding
show ntp status
show standby brief
show vrrp brief
show glbp brief

خرابی دور کرناTroubleshootingTroubleshooting

⚠️ Client کو DHCP سے IP نہیں مل رہا۔Client ko DHCP se IP nahi mil raha.Client not getting a DHCP address.

✅ چیک کریں: pool configured ہے؟ سرور اسی subnet میں ہے ورنہ helper-address لگا ہے؟ Pool ختم تو نہیں؟ انٹرفیس down تو نہیں؟Check karein: pool configured hai? Server isi subnet mein hai warna helper-address laga hai? Pool khatam to nahi? Interface down to nahi?Check: is the pool configured? Is the server in the same subnet, else is helper-address set? Is the pool exhausted or the interface down?

⚠️ NTP 'unsynchronized' پر پھنسا ہے۔NTP 'unsynchronized' par phansa hai.NTP stuck at 'unsynchronized'.

✅ عام طور پر key match نہیں ہوتی یا stratum غلط ہے (زیادہ stratum نمبر والے سرور سے sync نہیں ہوتا)۔ پہلے key، پھر source درست کریں۔Aam tor par key match nahi hoti ya stratum ghalat hai (zyada stratum number wale server se sync nahi hota). Pehle key, phir source durust karein.Usually the key doesn't match or the stratum is wrong (you can't sync to a server with a higher stratum number). Fix the key, then the source.

⚠️ HSRP active/standby ادھر ادھر ہو رہا ہے۔HSRP active/standby idhar udhar ho raha hai.HSRP active/standby flapping.

✅ Preempt اور timers دونوں روٹرز پر match کریں، اور tracked object کی حالت چیک کریں۔Preempt aur timers dono routers par match karein, aur tracked object ki state check karein.Check preempt + timers match on both routers, and verify the tracked object's state.

انٹرویو سوالاتInterview Q&AInterview Q&A

❓ ہر VLAN کے لیے الگ DHCP server کی بجائے DHCP relay کیوں استعمال کرتے ہیں؟Har VLAN ke liye alag DHCP server ki bajaye DHCP relay kyun use karte hain?Why use DHCP relay instead of a server per VLAN?

DHCP relay (helper-address) broadcast کو دوسرے subnet کے مرکزی DHCP server تک پہنچاتا ہے — ہر VLAN پر الگ سرور کی ضرورت ختم۔DHCP relay (helper-address) broadcast ko doosre subnet ke markazi DHCP server tak pohonchata hai — har VLAN par alag server ki zaroorat khatam.DHCP relay (helper-address) forwards broadcasts to a central DHCP server in another subnet — avoids one server per VLAN.

❓ HSRP، VRRP اور GLBP کا ایک ایک لائن میں موازنہ کریں۔HSRP, VRRP aur GLBP ka ek ek line mein muqabla karein.Compare HSRP, VRRP, and GLBP in one line each.

HSRP: Cisco، active/standby۔ VRRP: open standard، master/backup۔ GLBP: Cisco، active gateways پر load-balance کرتا ہے — ایک FHRP میں active-active forwarding۔HSRP: Cisco, active/standby. VRRP: open standard, master/backup. GLBP: Cisco, active gateways par load-balance karta hai — ek FHRP mein active-active forwarding.HSRP: Cisco, active/standby. VRRP: open standard, master/backup. GLBP: Cisco, active load-balances across gateways — one FHRP, active-active forwarding.