#17 same IP for two macs does not seem to work

open
nobody
None
5
2011-12-31
2011-12-31
No

I have a laptop with a wired and wireless interface. At work, it gets the same IP address for both MAC addresses, and this works seemlessly - when I plug or unplug the cable, the network keeps working, and ssh sessions stay open.

I want to have the same config at home, where I use a ReadyNAS Pro with the dualserver add-on. However, whenever I turn on the wifi, the wifi MAC gets an ip address from the free unknown pool instead of the same IP address as the wired got. Consequently the DNS then resolves the name for this host to the new/wrong ip address.

Here\'s part of the config:

otto=192.168.1.24

# otto wired
[00:21:CC:4A:56:D1]
IP_Addr=192.168.1.24

# otto wireless
# FIXME: dualserver doesn\'t let you give the same IP to two mac\'s at the same time ? why ?
[00:24:d7:9d:cd:54]
IP_Addr=192.168.1.24

If in this config I change the second IP_Addr to, say, .26 then the wifi MAC correctly gets that IP address (but that is not what I want). When it\'s at .24, it gets another one:

[31-Dec-11 10:34:08] DHCP discover for 00:24:d7:9d:cd:54 (otto) from interface 192.168.1.4 received
[31-Dec-11 10:34:08] Client 00:24:d7:9d:cd:54 (otto) offered 192.168.1.131
[31-Dec-11 10:34:08] DHCP request for 00:24:d7:9d:cd:54 (otto) from interface 192.168.1.4 received
[31-Dec-11 10:34:08] Client 00:24:d7:9d:cd:54 (otto) allotted 192.168.1.131 for 360000 seconds

Worse, it seems that DNS gets updated based on the name the laptop suggests and overwrites the hardcoded one - why would a random client name\'s suggestion take precedence over a hardcoded one in the config ?

Discussion

  • Achal Dhir
    Achal Dhir
    2012-01-01

    Hello Thomas,

    Thanks for writing.

    Fist, Is is allowed to have same IP on two different Interfaces in the same network or same computer. I don't think so. OS wont let you do that.

    Second, IP 192.168.1.131 must be comping from [DHCP-RANGE], please check the DHCP Range

    Thanks
    Achal

     
  • Achal Dhir
    Achal Dhir
    2012-01-01

    Also I dont see any hardcoded hostname in [00:21:CC:4A:56:D1] or [00:24:d7:9d:cd:54] section. Where did you hardcode the hostnames.

     
  • Woojin Park
    Woojin Park
    2012-01-02

    I agree to the opinion of achal.

     
  • Hi Achal,

    it is entirely possible. That is how I run it at work. Windows doesn't let you, but Linux is fine with it.

    See also http://serverfault.com/questions/81019/best-practices-to-set-up-laptop-with-wireless-and-wired-interface-nic-over-dhcp

    Output from ifconfig:
    em1 Link encap:Ethernet HWaddr 00:21:CC:4A:56:D1
    inet addr:172.17.4.46 Bcast:172.17.15.255 Mask:255.255.240.0
    inet6 addr: fe80::221:ccff:fe4a:56d1/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:2752664 errors:0 dropped:0 overruns:0 frame:0
    TX packets:2787922 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:2501716864 (2.3 GiB) TX bytes:1630692503 (1.5 GiB)
    Interrupt:20 Memory:d2500000-d2520000

    wlan0 Link encap:Ethernet HWaddr 00:24:D7:9D:CD:54
    inet addr:172.17.4.46 Bcast:172.17.15.255 Mask:255.255.240.0
    inet6 addr: fe80::224:d7ff:fe9d:cd54/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:393188 errors:0 dropped:0 overruns:0 frame:0
    TX packets:71578 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:103676536 (98.8 MiB) TX bytes:13833277 (13.1 MiB)

    The reason this is nice is because you can unplug the cable from the laptop, move to the meeting room, and everything stays connected, including things like ssh sessions.

    This is entirely possible with other DHCP servers, and I think it should be possible with yours too.

    As for your second comment, the host name is configured in the IP section as I pasted:
    otto=192.168.1.24

    Are you asking for something else instead? Are there other places where hostnames can be hardcoded ?

    Thanks,
    Thomas

     
  • The spam comment reminded me that this is unresolved.

    Do you have any reason to believe that it should not be supported to associate more than one MAC address with an IP address ?

    For the record, all other DHCP servers I know of support it.