Mutually exclusive IP/MAC addresses

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
Krieg
DD-WRT Novice


Joined: 05 Oct 2010
Posts: 3

PostPosted: Tue Oct 05, 2010 19:27    Post subject: Mutually exclusive IP/MAC addresses Reply with quote
I have two devices and I want that only one can access the Internet at the same time (the one that was switched on first). I do not care if the second device do not get any networking at all.

Any ideas?
Sponsor
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11564
Location: Wherever the wind blows- North America

PostPosted: Tue Oct 05, 2010 19:53    Post subject: Reply with quote
If you only have 2 devices...then set your DHCP to a block of 1.

So the first computer to get the lease....gets that one lease...the other should just timeout.

The downside is....if the first computer logs off (breaks the connection)...the lease has to expire before the DHCP server will give the one IP address to the next unit that asks.

That's the only thing I can think of.

redhawk

_________________
The only stupid question....is the unasked one.
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10141

PostPosted: Wed Oct 06, 2010 2:09    Post subject: Reply with quote
redhawk0 wrote:
The downside is....if the first computer logs off (breaks the connection)...the lease has to expire before the DHCP server will give the one IP address to the next unit that asks.

ie. Set the lease duration really low.

_________________
Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
Krieg
DD-WRT Novice


Joined: 05 Oct 2010
Posts: 3

PostPosted: Wed Oct 06, 2010 9:19    Post subject: Reply with quote
I have many other devices in the network.

Can I run a command from the DHCP after an IP is assigned? In that way I could block somehow with iptables the other device.
Krieg
DD-WRT Novice


Joined: 05 Oct 2010
Posts: 3

PostPosted: Wed Oct 06, 2010 10:03    Post subject: Reply with quote
I answer to myself:

It is possible to run commands with the "on events" configuration. But maybe it is easier to put all the devices in a class and put a limit in the number of leases for the class, in this case, 1.

I will test this during the weekend.
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11564
Location: Wherever the wind blows- North America

PostPosted: Wed Oct 06, 2010 12:23    Post subject: Reply with quote
phuzi0n wrote:
redhawk0 wrote:
The downside is....if the first computer logs off (breaks the connection)...the lease has to expire before the DHCP server will give the one IP address to the next unit that asks.

ie. Set the lease duration really low.


Agreed...but you will still have to wait for the timeout. or timeout/2 in our case.

so even a 5 minute lease time would take up to 2.5 minutes before it would release the address depending on the renewal time.

But...it would be manageable.

If you have many other devices on the network...set them all to a static IP address (outside the DHCP pool) This should eliminate any conflict cause by setting the DHCP pool to 1.


redhawk

_________________
The only stupid question....is the unasked one.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum