Skip to main content
HS08
Contributor III
July 16, 2025
Question

IP Addr SNMP

  • July 16, 2025
  • 3 replies
  • 555 views

What oid can be used for get IP address for specific port, example ip for ifindex3.

3 replies

AEK
SuperUser
SuperUser
July 16, 2025

Trying snmpwalk and found this on my FGT (6.2.16):

iso.3.6.1.2.1.4.20.1.1.x.x.x.x = IpAddress: x.x.x.x
iso.3.6.1.2.1.4.20.1.2.x.x.x.x = INTEGER: y

Where x.x.x.x is IP address of the interface, and y is the snmp-index.

Not exactly what you are looking for but it may help a bit.

AEK
HS08
HS08Author
Contributor III
July 18, 2025

Currently i build simple SNMP manager application then i need to query ip address from port1 where the ip from port1 using DHCP from ISP. So i need the oid to query the ip address to be integrated with my own application.

AEK
SuperUser
SuperUser
July 20, 2025

With what you have in hand, I guess your only option is customize the script to do snmpwalk on "iso.3.6.1.2.1.4.20.1.2." and it may select the entry that correspond the right snmp-index, and then it will need to extract the IP from the output with some command like "re.search" in python.

AEK
Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!