LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-17-2014, 09:33 AM   #1
jluce50
LQ Newbie
 
Registered: Sep 2014
Posts: 2

Rep: Reputation: Disabled
Run script on new lease only for certain interface


In a nutshell, what I'm trying to do is send a message (using curl) when a new lease is acquired on my guest network (interface == wl0.1). I was thinking I could use dnsmasq's "dhcp-script" option, but I don't see a way to restrict that to only wl0.1. So it's looking like I'll need to do this with iptables, but I'm unclear how to determine when a new lease is acquired with iptables. Can anyone point me in the right direction?
 
Old 09-17-2014, 10:45 AM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,792

Rep: Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220Reputation: 2220
In the dhcp-script, one of the environment variables is DNSMASQ_INTERFACE, the name of the interface on which the request arrived. Your script could easily check for that.
 
Old 09-17-2014, 11:53 AM   #3
jluce50
LQ Newbie
 
Registered: Sep 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Ah, I didn't see that. Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run auto script when interface comes up or down on centos bobo0110 Linux - Server 1 03-15-2011 04:31 AM
run auto script when interface comes up or down on centos bobo0110 Linux - Newbie 2 03-15-2011 02:15 AM
how to run script on event ppp0 interface going down ? qwijibow Linux - Networking 4 02-24-2004 06:08 AM
Re-run IPTables script after Lease Renewal Spotnik Linux - Networking 4 02-01-2004 07:11 AM
Getting DHCP client lease without configuring interface chenlevy Linux - Networking 0 09-02-2001 10:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration