Discussion:
Assign IP address to a remote device by its MAC
(too old to reply)
Boaz Ben-Porat
2007-01-24 09:19:52 UTC
Permalink
Hi all

Ho do I, PROGRAMMATICALLY, assign IP attributes (IP address, Default
Gateway, Subnet Mask, Port) to a remote device on the local network?
I know that the command 'ARP -s <IP address> <MAC address>' assigns the <IP
address> to the devoce wich has the <MAC address>, and that BOOTP protocol
is used for all attribtes.

Is the an API for these commands/Protocols? A sample code will, of course'
be very appreciated.

TIA

Boaz Ben-Porat

Milestone Systems A/S
Denmark
Ben Voigt
2007-01-24 14:38:14 UTC
Permalink
Post by Boaz Ben-Porat
Hi all
Ho do I, PROGRAMMATICALLY, assign IP attributes (IP address, Default
Gateway, Subnet Mask, Port) to a remote device on the local network?
In general, you can't. You can communicate with software on the remote
machine which will make the changes if it trusts you. Some devices (network
appliances) can't change their configuration at all.
Post by Boaz Ben-Porat
I know that the command 'ARP -s <IP address> <MAC address>' assigns the
<IP address> to the devoce wich has the <MAC address>, and that BOOTP
protocol
No, it doesn't. ARP updates your local IP->MAC mapping table, and has no
effect on any other device on the network, only your ability to communicate
with them.
Post by Boaz Ben-Porat
is used for all attribtes.
BOOTP or DHCP can in fact assign the information you are talking about, but
the timing is determined by the client device. You cannot "push" new
configurations.
Post by Boaz Ben-Porat
Is the an API for these commands/Protocols? A sample code will, of course'
be very appreciated.
If you run a BOOTP/DHCP server, then you may be able to control the
configuration it sends to clients. A lot of them use simple text files and
a simple API to reload the configuration when the files change. This will
not cause any client to update its configuration until the client OS decides
to contact the DHCP/BOOTP server again.
Post by Boaz Ben-Porat
TIA
Boaz Ben-Porat
Milestone Systems A/S
Denmark
Arkady Frenkel
2007-01-24 16:47:04 UTC
Permalink
One such agent is WMI ( wbem ) , so if device/computer have such support,
possible using Win32_NetworkAdapterConfiguration interface ( for Windows )
call EnableStatic() with desired IP and so on
Arkady
Post by Ben Voigt
Post by Boaz Ben-Porat
Hi all
Ho do I, PROGRAMMATICALLY, assign IP attributes (IP address, Default
Gateway, Subnet Mask, Port) to a remote device on the local network?
In general, you can't. You can communicate with software on the remote
machine which will make the changes if it trusts you. Some devices
(network appliances) can't change their configuration at all.
Post by Boaz Ben-Porat
I know that the command 'ARP -s <IP address> <MAC address>' assigns the
<IP address> to the devoce wich has the <MAC address>, and that BOOTP
protocol
No, it doesn't. ARP updates your local IP->MAC mapping table, and has no
effect on any other device on the network, only your ability to
communicate with them.
Post by Boaz Ben-Porat
is used for all attribtes.
BOOTP or DHCP can in fact assign the information you are talking about,
but the timing is determined by the client device. You cannot "push" new
configurations.
Post by Boaz Ben-Porat
Is the an API for these commands/Protocols? A sample code will, of
course' be very appreciated.
If you run a BOOTP/DHCP server, then you may be able to control the
configuration it sends to clients. A lot of them use simple text files
and a simple API to reload the configuration when the files change. This
will not cause any client to update its configuration until the client OS
decides to contact the DHCP/BOOTP server again.
Post by Boaz Ben-Porat
TIA
Boaz Ben-Porat
Milestone Systems A/S
Denmark
Ben Voigt
2007-01-24 17:45:36 UTC
Permalink
Post by Arkady Frenkel
One such agent is WMI ( wbem ) , so if device/computer have such support,
possible using Win32_NetworkAdapterConfiguration interface ( for Windows )
call EnableStatic() with desired IP and so on
WMI runs atop unicast IP, so changing IP parameters underneath is a
dangerous game -- you'll likely end up with an inconsistent configuration,
unable to connect to the target to complete the change.
Post by Arkady Frenkel
Arkady
Post by Ben Voigt
Post by Boaz Ben-Porat
Hi all
Ho do I, PROGRAMMATICALLY, assign IP attributes (IP address, Default
Gateway, Subnet Mask, Port) to a remote device on the local network?
In general, you can't. You can communicate with software on the remote
machine which will make the changes if it trusts you. Some devices
(network appliances) can't change their configuration at all.
Post by Boaz Ben-Porat
I know that the command 'ARP -s <IP address> <MAC address>' assigns the
<IP address> to the devoce wich has the <MAC address>, and that BOOTP
protocol
No, it doesn't. ARP updates your local IP->MAC mapping table, and has no
effect on any other device on the network, only your ability to
communicate with them.
Post by Boaz Ben-Porat
is used for all attribtes.
BOOTP or DHCP can in fact assign the information you are talking about,
but the timing is determined by the client device. You cannot "push" new
configurations.
Post by Boaz Ben-Porat
Is the an API for these commands/Protocols? A sample code will, of
course' be very appreciated.
If you run a BOOTP/DHCP server, then you may be able to control the
configuration it sends to clients. A lot of them use simple text files
and a simple API to reload the configuration when the files change. This
will not cause any client to update its configuration until the client OS
decides to contact the DHCP/BOOTP server again.
Post by Boaz Ben-Porat
TIA
Boaz Ben-Porat
Milestone Systems A/S
Denmark
Arkady Frenkel
2007-01-25 08:00:59 UTC
Permalink
AFAIK that work pretty nice in the admin scripts for network configuration
( which was born for ... ) , so don't see the reason why it willn't work for
computer ( at least inside the LAN ) with specific MAC
Arkady
Post by Ben Voigt
Post by Arkady Frenkel
One such agent is WMI ( wbem ) , so if device/computer have such support,
possible using Win32_NetworkAdapterConfiguration interface ( for
Windows ) call EnableStatic() with desired IP and so on
WMI runs atop unicast IP, so changing IP parameters underneath is a
dangerous game -- you'll likely end up with an inconsistent configuration,
unable to connect to the target to complete the change.
Post by Arkady Frenkel
Arkady
Post by Ben Voigt
Post by Boaz Ben-Porat
Hi all
Ho do I, PROGRAMMATICALLY, assign IP attributes (IP address, Default
Gateway, Subnet Mask, Port) to a remote device on the local network?
In general, you can't. You can communicate with software on the remote
machine which will make the changes if it trusts you. Some devices
(network appliances) can't change their configuration at all.
Post by Boaz Ben-Porat
I know that the command 'ARP -s <IP address> <MAC address>' assigns the
<IP address> to the devoce wich has the <MAC address>, and that BOOTP
protocol
No, it doesn't. ARP updates your local IP->MAC mapping table, and has
no effect on any other device on the network, only your ability to
communicate with them.
Post by Boaz Ben-Porat
is used for all attribtes.
BOOTP or DHCP can in fact assign the information you are talking about,
but the timing is determined by the client device. You cannot "push"
new configurations.
Post by Boaz Ben-Porat
Is the an API for these commands/Protocols? A sample code will, of
course' be very appreciated.
If you run a BOOTP/DHCP server, then you may be able to control the
configuration it sends to clients. A lot of them use simple text files
and a simple API to reload the configuration when the files change.
This will not cause any client to update its configuration until the
client OS decides to contact the DHCP/BOOTP server again.
Post by Boaz Ben-Porat
TIA
Boaz Ben-Porat
Milestone Systems A/S
Denmark
Loading...