mshenoy Posted September 5, 2009 Share Posted September 5, 2009 So my setup is a Linksys WRT160 N and 2 machines 1 running a windows xp and another an Ubuntu 8.10. I want to know if there is a way that the router can send a message to my PC when it receives a DHCP request and grants it an IP address. Like for instance when the IP address is granted it has the MAC address too so it sends a message "YOUR IP (internal or external is 0.0.0.0) " Now, I know the router (WRT160n) has a log of the DHCP requests with the mac addresses and the IP addresses as well. Since I have an Ubuntu machine could I access this log through the machine and have a cron job running to check for IP addresses assigned or could this be done through the Router by its own. I just care about the messaging functionality...I am sure there is a way ....I am looking into it....but do any of you guys know how this could be accomplished ?? Quote Link to comment Share on other sites More sharing options...
Sparda Posted September 5, 2009 Share Posted September 5, 2009 Many routers will send logs to a email address. This possibly will do what you require depending on if emails can be sent using DHCP requests as a trigger. Alternatively, this information may be available from the router using SNMP. The alternative that doesn't involve the router at all would be to run tcpdump (or some thing like that) and trigger an event on DHCP requests. Quote Link to comment Share on other sites More sharing options...
mshenoy Posted September 5, 2009 Author Share Posted September 5, 2009 Many routers will send logs to a email address. This possibly will do what you require depending on if emails can be sent using DHCP requests as a trigger. Alternatively, this information may be available from the router using SNMP. The alternative that doesn't involve the router at all would be to run tcpdump (or some thing like that) and trigger an event on DHCP requests. Thanks boris for your insight. Well I will try looking into tcpdump and the likes. And also let me try to add to this if it can clarify further what I need. For instance, I turn my PC on and it sends a DHCP request, The router gets the MAC and assigns an IP address, From here I would like the router to start a program or open a browser by pinging to the machine or starting a cron or something. Like the chrome browser stores your browsing habits what if the router could recognize your MAC and start a set of programs on boot. That is what I thought of initially. I know the router does have flash memory which has limited writes but again just wanted to know if we could start these processes via just the communication protocols. Could you critique on this. Quote Link to comment Share on other sites More sharing options...
georgebush Posted September 7, 2009 Share Posted September 7, 2009 Great work .. really informative .. and thanks a lot for sharing electric adjustable beds prices frames sleep comfort reviews the best electic adjustable beds at the lowest prices electric adjustable beds prices frames sleep comfort reviews Quote Link to comment Share on other sites More sharing options...
BatteryShock Posted September 7, 2009 Share Posted September 7, 2009 Just to throw this in there, I have seen routers which can actually write to syslog. See if your supports this feature. You will have to have a linux box for that and give the router the ip address for the linux box. This should log all info to your linux box from where you can extract DHCP information using scripts. Check your router if it supports this scenario. :) Quote Link to comment Share on other sites More sharing options...
Brian Sierakowski Posted September 8, 2009 Share Posted September 8, 2009 So, bottom line you're looking to be able to DHCP, but based on MAC address be able to load settings specific to that machine? Quote Link to comment Share on other sites More sharing options...
mshenoy Posted September 9, 2009 Author Share Posted September 9, 2009 So, bottom line you're looking to be able to DHCP, but based on MAC address be able to load settings specific to that machine? yes somewhat close .....based on MAC address identify a machine and load a set of programs as per preference Quote Link to comment Share on other sites More sharing options...
Brian Sierakowski Posted September 19, 2009 Share Posted September 19, 2009 yes somewhat close .....based on MAC address identify a machine and load a set of programs as per preference All might be lost, to the best of my knowledge not even traditional DHCP can change program settings besides the DHCP options. Layer 3 < Layer 7. Quote Link to comment Share on other sites More sharing options...
3w`Sparky Posted September 19, 2009 Share Posted September 19, 2009 your basically looking for a ping sweep combined with arp entries to see whats on your lan and the ip address & mac of that device. i have to ask whats this for ? Quote Link to comment Share on other sites More sharing options...
3w`Sparky Posted September 22, 2009 Share Posted September 22, 2009 i think i miss understood , your looking to boot your pc and at the point of it being assigned an ip address that same device is going to start a program running on that PC that was just allocated the lease, well for a start your going to need a program that is going to accept requests running on the pc just allocated the lease, the router will need a cronjob every 1 min or so to check its dhcp allocations if it contains xx:xx:xx:xx mac address then do something else die. i would think for pure lab testing good old netcat might do this, one on your booted pc set to auto start and the other on the router configured as part of the cronjob, the test - i would use something like calc on windows, if you netcat from one device to another to get a cmd prompt then you can just run calc from the remote pc and it will fire up calc on the desktop for the current user. still the question is why but thats what i would do for the lab steps anyway, if it produces the required results then i would look at hardening the setup by building an app thats abit more secure. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.