VMware Networking Community
brietmax
Contributor
Contributor
Jump to solution

dhcp server on segment

hello

I had configured a dhcp server on one segment.

is it a way to see the allocated ip address?

regards

Labels (1)
0 Kudos
1 Solution

Accepted Solutions
wenlaoshi
Contributor
Contributor
Jump to solution

Go to the cli of one of your edge nodes and run the following command:

get dhcp leases all

This will give you all allocated IP addresses

In case you're interested in a specific subnet (10.7.12.0 in this example), you can do it like this:

ssh admin@edge-01 get dhcp leases all | grep -B 9 'SUBNET: 10.7.12.0'

You will see output in the following format:

....

--
    DHCP_ID: c7ad57af-4017-41c0-ad52-9cff451b83c7
    DHCP_SUBNET_MAC: c7ad57af-4017-41c0-ad52-9cff451b83c7_10.7.12.249_00:50:56:bc:e8:40
    EXPIRE_TIME: 2021-11-18 08:26:38.276000 (timestamp: 1637223998276)
    IP:
        IPV4: 10.7.12.249
    LEASE_TIME: 3600
    MAC:
        MAC: 00:50:56:bc:e8:40
    START_TIME: 2021-11-18 07:26:38.276000 (timestamp: 1637220398276)
    SUBNET: 10.7.12.0
--
    DHCP_ID: c7ad57af-4017-41c0-ad52-9cff451b83c7
    DHCP_SUBNET_MAC: c7ad57af-4017-41c0-ad52-9cff451b83c7_10.7.12.250_00:50:56:bc:32:ed
    EXPIRE_TIME: 2021-11-15 11:26:28.798000 (timestamp: 1636975588798)
    IP:
        IPV4: 10.7.12.250
    LEASE_TIME: 3600
    MAC:
        MAC: 00:50:56:bc:32:ed
    START_TIME: 2021-11-15 10:26:28.798000 (timestamp: 1636971988798)
    SUBNET: 10.7.12.0

....

In case you want to run commands on an edge node automatically, you can set your ssh public key like this:

set user admin ssh-keys label mylabel type ssh-rsa value AAAAB3NzaC1yc.......

View solution in original post

0 Kudos
1 Reply
wenlaoshi
Contributor
Contributor
Jump to solution

Go to the cli of one of your edge nodes and run the following command:

get dhcp leases all

This will give you all allocated IP addresses

In case you're interested in a specific subnet (10.7.12.0 in this example), you can do it like this:

ssh admin@edge-01 get dhcp leases all | grep -B 9 'SUBNET: 10.7.12.0'

You will see output in the following format:

....

--
    DHCP_ID: c7ad57af-4017-41c0-ad52-9cff451b83c7
    DHCP_SUBNET_MAC: c7ad57af-4017-41c0-ad52-9cff451b83c7_10.7.12.249_00:50:56:bc:e8:40
    EXPIRE_TIME: 2021-11-18 08:26:38.276000 (timestamp: 1637223998276)
    IP:
        IPV4: 10.7.12.249
    LEASE_TIME: 3600
    MAC:
        MAC: 00:50:56:bc:e8:40
    START_TIME: 2021-11-18 07:26:38.276000 (timestamp: 1637220398276)
    SUBNET: 10.7.12.0
--
    DHCP_ID: c7ad57af-4017-41c0-ad52-9cff451b83c7
    DHCP_SUBNET_MAC: c7ad57af-4017-41c0-ad52-9cff451b83c7_10.7.12.250_00:50:56:bc:32:ed
    EXPIRE_TIME: 2021-11-15 11:26:28.798000 (timestamp: 1636975588798)
    IP:
        IPV4: 10.7.12.250
    LEASE_TIME: 3600
    MAC:
        MAC: 00:50:56:bc:32:ed
    START_TIME: 2021-11-15 10:26:28.798000 (timestamp: 1636971988798)
    SUBNET: 10.7.12.0

....

In case you want to run commands on an edge node automatically, you can set your ssh public key like this:

set user admin ssh-keys label mylabel type ssh-rsa value AAAAB3NzaC1yc.......

0 Kudos