0

I have a feeling that question itself looks stupid but it is not. Please let me clarify.

I have dynamic DNS with BIND and NIS configured at my LAN and have laptop which I am using in both wireless and wired mode. I mean that sometimes I have to use wired interface to achieve higher throughput but most of time I don't need it and using wireless mode. Everything works great.

Issue is that I want both interfaces get same IP from DHCP. Just for convenient firewall setup.

If I add both hosts to dhcp in this manner

# bt wireless
  host bt {
  hardware ethernet 00:1f:1f:62:60:28;
  fixed-address 172.16.77.110;
}
# bt wired
host bt {
  hardware ethernet 00:14:22:b7:5a:de;
  fixed-address 172.16.77.110;
}

DHCP says logs following message

dhcpd: Dynamic and static leases present for 172.16.77.110
dhcpd: Remove host declaration bt-wired or remove 172.16.77.110
dhcpd: from the dynamic address pool for 172.16/16

Host records are added outside of any subnet, but it makes no difference if I put them there, effect is still the same.

This is not critical but either is not my whim because even if DHCP seems to work fine for that "bt" host, I cannot make connection TO it from remote machine anymore with this definitely incorrect DHCP config.

I'd be thankful if one spares a minute for advice about how to configure DHCPD correctly.

UPDATE. I realize that there's a soulution to assign different hostname in DHCP config but would like to use benefits of short host names.

5
  • Do you ever intend to have both wireless and wired active at the same time? If so, having two different interfaces with different MACs but the same IP is going to cause some interesting side effects. You might be better just updating the firewall for two separate IPs, either one of which might be in use at any particular time... Also, I may be wrong, but I think both host <tag> {} entries need to have different <tag>s...
    – twalberg
    Jun 28, 2012 at 19:32
  • Thanks for comment twalberg. No, I never need them at the same time. Did not even thought of it ;)
    – Egeshi
    Jun 28, 2012 at 19:36
  • So you switch off the wireless the very second you connect the cable ? ;)
    – Alex
    Jun 28, 2012 at 20:39
  • Btw, it's a question for superuser, not stackoverflow.
    – Alex
    Jun 28, 2012 at 20:48
  • Why not use different IPs but same domain name? There is no problem for one fqdn to have multiple IPs nor for linking two different IPs PTR to the same fqdn.
    – mbx
    Apr 7, 2013 at 2:33

2 Answers 2

0

If the wireless is always on, and wired is sometimes on: Assign (with DHCP) the "primary" IP to your wifi interface, and "secondary" IP to your wired one. Add a static route on your router that makes the "secondary" IP gateway for the "primary" one, with route metric lower than metric of the wifi interface. (I think you will also need to enable interface bridging on your machine, if it's not enabled by default in your OS).

If wireless is not always on, you will have to assign "primary" IP statically on the machine itself, without DHCP.

0

I'm not terribly versed in the command line config, but can you just drop the dhcp lease time to some ridiculously low value? So the lease assigned to your wireless adapter expires a minute after disconnecting?

Or perhaps just manually release the lease when you switch adapters. You could probably write a batch file to do that with a double clickable icon.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .