cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
419
Views
2
Helpful
8
Replies

ASR9903 - How to send DHCP Requests/Offer to syslog server

Hej
Can anyone help me with sending any DHCP Request / Offer message my device receives/Sends to a syslog server? I could not find the option for dhcp on syslog. I would be ok with doing it with telemetry as well

ASR9903 IoSXR 24.2.1
Regards

1 Accepted Solution

Accepted Solutions

Hello,

To send DHCP Request/Offer messages to a syslog server on your ASR9903 running IOS XR 24.2.1, you can follow these approaches:

1. Syslog with Embedded Event Manager (EEM):
Since DHCP events might not be directly logged by default in IOS XR, you can use the Embedded Event Manager (EEM) to trigger syslog messages when DHCP-related activities occur.

Here’s an outline of how to achieve this using EEM:

Step 1: Define an EEM Applet to monitor the DHCP process. You can monitor the DHCP process using EEM and then log the output to the syslog server.

event manager applet DHCP_Log_Syslog
event syslog pattern "DHCP" ! Adjust this pattern for DHCP messages
action 1.0 syslog msg "DHCP Event Detected"

Step 2: Configure the Syslog server on your router. Make sure to configure the router to send logs to the syslog server.

logging host <syslog-server-ip>
logging trap informational


You’ll need to adjust the syslog patterns to specifically target the DHCP messages.

2. Using Telemetry:
If you'd prefer to use telemetry, you can set up model-driven telemetry (MDT) to capture and stream the DHCP-related data to a server.

Step 1: Create a Telemetry Subscription
You can set up a subscription to capture DHCP information. IOS XR has YANG models for DHCP, which you can use to capture events like DHCP discovery, offer, request, etc.

telemetry model-driven
sensor-group dhcp-sensor
sensor-path DHCP.YANG_PATH ! Replace with correct DHCP YANG path
!
subscription dhcp-subscription
sensor-group-id dhcp-sensor sample-interval 30000
destination-group dhcp-telemetry-destination
!
destination-group dhcp-telemetry-destination
address-family ipv4 10.1.1.2 port 50051 ! Your telemetry server IP and port
encoding gpb
protocol grpc
!
commit


You'll need to find the appropriate YANG model path for DHCP within IOS XR.

Step 2: Configure the Telemetry Server
On your telemetry server, ensure it is set up to receive and process the gRPC telemetry data being streamed from the ASR device.

3. Enable DHCP Snooping (Optional):
If you want more granular monitoring of DHCP traffic, enabling DHCP snooping on the router could provide additional logs related to DHCP packets, which can then be forwarded to syslog or processed via telemetry.

interface GigabitEthernet0/0/0
ip dhcp snooping trust
!
ip dhcp snooping


These options should help you track DHCP messages on your syslog or telemetry setup.

View solution in original post

8 Replies 8

Just to confirm it ASR IOS Xr or IOS Xe

MHM

ASR9903 IoSXR 24.2.1 

I have updated the opening post as well, thanks for pointing it out

M02@rt37
VIP
VIP

Hello @oscardenizjensen 

Do you identify the YANG model that includes the DHCP-related information you want to monitor ?

Best regards
.ı|ı.ı|ı. If This Helps, Please Rate .ı|ı.ı|ı.

No I have not, but I would appreciate help or direction regarding how to

Hello,

To send DHCP Request/Offer messages to a syslog server on your ASR9903 running IOS XR 24.2.1, you can follow these approaches:

1. Syslog with Embedded Event Manager (EEM):
Since DHCP events might not be directly logged by default in IOS XR, you can use the Embedded Event Manager (EEM) to trigger syslog messages when DHCP-related activities occur.

Here’s an outline of how to achieve this using EEM:

Step 1: Define an EEM Applet to monitor the DHCP process. You can monitor the DHCP process using EEM and then log the output to the syslog server.

event manager applet DHCP_Log_Syslog
event syslog pattern "DHCP" ! Adjust this pattern for DHCP messages
action 1.0 syslog msg "DHCP Event Detected"

Step 2: Configure the Syslog server on your router. Make sure to configure the router to send logs to the syslog server.

logging host <syslog-server-ip>
logging trap informational


You’ll need to adjust the syslog patterns to specifically target the DHCP messages.

2. Using Telemetry:
If you'd prefer to use telemetry, you can set up model-driven telemetry (MDT) to capture and stream the DHCP-related data to a server.

Step 1: Create a Telemetry Subscription
You can set up a subscription to capture DHCP information. IOS XR has YANG models for DHCP, which you can use to capture events like DHCP discovery, offer, request, etc.

telemetry model-driven
sensor-group dhcp-sensor
sensor-path DHCP.YANG_PATH ! Replace with correct DHCP YANG path
!
subscription dhcp-subscription
sensor-group-id dhcp-sensor sample-interval 30000
destination-group dhcp-telemetry-destination
!
destination-group dhcp-telemetry-destination
address-family ipv4 10.1.1.2 port 50051 ! Your telemetry server IP and port
encoding gpb
protocol grpc
!
commit


You'll need to find the appropriate YANG model path for DHCP within IOS XR.

Step 2: Configure the Telemetry Server
On your telemetry server, ensure it is set up to receive and process the gRPC telemetry data being streamed from the ASR device.

3. Enable DHCP Snooping (Optional):
If you want more granular monitoring of DHCP traffic, enabling DHCP snooping on the router could provide additional logs related to DHCP packets, which can then be forwarded to syslog or processed via telemetry.

interface GigabitEthernet0/0/0
ip dhcp snooping trust
!
ip dhcp snooping


These options should help you track DHCP messages on your syslog or telemetry setup.

Thank you very much I will try this one out

Thanks, We have tested the telemetry and seem to be able to get information. Just need to fine tune it now

You're welcome!

Happy it worked for you.

Review Cisco Networking for a $25 gift card