Obtain subnet mask of host
#1
Scooby Regular
Thread Starter
Join Date: Apr 2004
Location: Cardiff
Posts: 1,928
Likes: 0
Received 0 Likes
on
0 Posts
Obtain subnet mask of host
Hello all,
I have an issue finding a hosts subnet mask.
I have a website that people access to register for a service on their host computers. There are DOS commands which run inside a PHP script to obtain their IP and MAC address however ideally we also need to obtain subnet mask of the machine.
Does anyone know of a way to do this,ideally I need the webpage to obtain the info without using remote IP tools
Mike
I have an issue finding a hosts subnet mask.
I have a website that people access to register for a service on their host computers. There are DOS commands which run inside a PHP script to obtain their IP and MAC address however ideally we also need to obtain subnet mask of the machine.
Does anyone know of a way to do this,ideally I need the webpage to obtain the info without using remote IP tools
Mike
#3
Scooby Regular
impossible -- the subnet mask is only of value when on the same LAN segment as the host i.e. to determin whether an IP address belongs on the LAN segment.
over the wan it will just be 255.255.255.255 (or assumed to be -- i.e. the host)
over the wan it will just be 255.255.255.255 (or assumed to be -- i.e. the host)
Last edited by hodgy0_2; 11 January 2011 at 07:22 PM.
#4
Scooby Regular
Thread Starter
Join Date: Apr 2004
Location: Cardiff
Posts: 1,928
Likes: 0
Received 0 Likes
on
0 Posts
Thanks Both
Hodgy - The machines that access the website are on the same Autonomous System so to speak with public IP's. However, they will be on seperate VLAN's to the server itself, so I'm guessing this is still a no no.
Mike
Hodgy - The machines that access the website are on the same Autonomous System so to speak with public IP's. However, they will be on seperate VLAN's to the server itself, so I'm guessing this is still a no no.
Mike
#5
Scooby Regular
hi
does your application see the remote host’s real ip address or a natted address.
the MAC address that you get, presumably this is the MAC address of the DG interface of your Host/Application LAN segment
I would have thought the actual MAC address of the host can only be retrieved by an ARP request from a device (Router Interface) on the hosts LAN segment - do you do this?
does your application see the remote host’s real ip address or a natted address.
the MAC address that you get, presumably this is the MAC address of the DG interface of your Host/Application LAN segment
I would have thought the actual MAC address of the host can only be retrieved by an ARP request from a device (Router Interface) on the hosts LAN segment - do you do this?
#6
Scooby Regular
iTrader: (7)
Join Date: Nov 2009
Location: Leeds
Posts: 579
Likes: 0
Received 0 Likes
on
0 Posts
Yeah - I guess if you're in the same AS and you're *not* having to NAT then the subnet mask would be useful. However, is there asymmetric routing going on, one with a smaller mask to another?
If it's just a client, can the script in DOS not just grab the full ipconfig / all data and strip out the data it needs?
I guess if it goes through a gateway or part of a summarised network, the actual mask itself of the host wouldn't be any use?
If it's just a client, can the script in DOS not just grab the full ipconfig / all data and strip out the data it needs?
I guess if it goes through a gateway or part of a summarised network, the actual mask itself of the host wouldn't be any use?
#7
Scooby Regular
Thread Starter
Join Date: Apr 2004
Location: Cardiff
Posts: 1,928
Likes: 0
Received 0 Likes
on
0 Posts
hi
does your application see the remote host’s real ip address or a natted address.
the MAC address that you get, presumably this is the MAC address of the DG interface of your Host/Application LAN segment
I would have thought the actual MAC address of the host can only be retrieved by an ARP request from a device (Router Interface) on the hosts LAN segment - do you do this?
does your application see the remote host’s real ip address or a natted address.
the MAC address that you get, presumably this is the MAC address of the DG interface of your Host/Application LAN segment
I would have thought the actual MAC address of the host can only be retrieved by an ARP request from a device (Router Interface) on the hosts LAN segment - do you do this?
* to get the MAC we fire the nbtstat command out to the machine, this returns the mac of the host
* Pretty sure it's just the nbtstat command to get the Mac
Trending Topics
#8
Scooby Regular
Thread Starter
Join Date: Apr 2004
Location: Cardiff
Posts: 1,928
Likes: 0
Received 0 Likes
on
0 Posts
Yeah - I guess if you're in the same AS and you're *not* having to NAT then the subnet mask would be useful. However, is there asymmetric routing going on, one with a smaller mask to another?
If it's just a client, can the script in DOS not just grab the full ipconfig / all data and strip out the data it needs?
I guess if it goes through a gateway or part of a summarised network, the actual mask itself of the host wouldn't be any use?
If it's just a client, can the script in DOS not just grab the full ipconfig / all data and strip out the data it needs?
I guess if it goes through a gateway or part of a summarised network, the actual mask itself of the host wouldn't be any use?
* Yes I'm guessing there must be a way to search for *255.255* and take the data after it
* We need the mask for the machine as we send out a magic packet to it to wake it up.
In a nutshell the service is so staff members can wake up their machines from home as we forcefully power them off every night to save power.
They log in to a website from their staff machine and register for the "wake up service"
This logs their username, mac and IP however it assumes the network is always a /24 network, so users who are on a /27 who try to wake up their machines can't.
The users can then log into the website from home and type their username and hit "wake up" which poweres their machine on.
#10
Scooby Regular
Thread Starter
Join Date: Apr 2004
Location: Cardiff
Posts: 1,928
Likes: 0
Received 0 Likes
on
0 Posts
clients use Static IP's via DHCP
not sure if a helper is used ..... I know networks are reluctant to give those out.
I think the routers are tweaked to allow the DHCP ACK across VLAN's as its on a seperate subnet to other machines.
Thanks all
not sure if a helper is used ..... I know networks are reluctant to give those out.
I think the routers are tweaked to allow the DHCP ACK across VLAN's as its on a seperate subnet to other machines.
Thanks all
#11
Scooby Regular
do you know the IP ranges used in the network (with subnet addressing)
if so could you not create you own "DHCP" type database, then when you know the IP address of the connecting client you could do a lookup against your database to find the correct subnet mask
if so could you not create you own "DHCP" type database, then when you know the IP address of the connecting client you could do a lookup against your database to find the correct subnet mask
#14
Get them to export the data out regularly or set it up to replicate to another DB?
Anyway, how are you getting the magic packet routed across your subnets?
#16
#17
Scooby Regular
Thread Starter
Join Date: Apr 2004
Location: Cardiff
Posts: 1,928
Likes: 0
Received 0 Likes
on
0 Posts
Hodgy, HHxx
Many thanks for the pointers
I'll see if networks will let us intergrate the database
Networks have tweaked the ACL's to allow the machine that wakes up other machines to send magic packets across VLAN's, no other machines are allowed to do this.
I think networks would give us the IP map as it were, but we wanted it to be dynamic so to speak as VLAN's are altered from time to time.
Ill have a word with networks.
Mike
Many thanks for the pointers
I'll see if networks will let us intergrate the database
Networks have tweaked the ACL's to allow the machine that wakes up other machines to send magic packets across VLAN's, no other machines are allowed to do this.
I think networks would give us the IP map as it were, but we wanted it to be dynamic so to speak as VLAN's are altered from time to time.
Ill have a word with networks.
Mike
Thread
Thread Starter
Forum
Replies
Last Post
IWatkins
ScoobyNet General
1
24 October 2000 10:46 AM