1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

two laptop interfaces, one ip address

Discussion in 'Asuswrt-Merlin' started by bananabrain, Sep 15, 2019.

  1. bananabrain

    bananabrain New Around Here

    Joined:
    Sep 15, 2019
    Messages:
    3
    Good morning,

    (RT-AC86U/384.13)


    I've been trying to get a laptop to take the same ip address for both wireless and ethernet interfaces from the dhcp server. There's no possiblility of these interfaces being up simultaneously.

    I've enabled custom scripts in the webui and put the following in /jffs/scripts/dnsmasq.postconf, according to the dnsmasq manpage and the asuswrt-merlin wiki...

    Code:
    #!/bin/sh
    CONFIG=$1
    source /usr/sbin/helper.sh
    pc_replace "dhcp-host=x:x:x:x:x:EE,192.168.1.102" "dhcp-host=x:x:x:x:x:EE,x:x:x:x:x:06,192.168.1.102" $CONFIG
    
    EE is wireless, 06 is ethernet. It works beautifully and modifies /etc/dnsmasq.conf as expected.

    My problem is that I can't find a way to translate that to something useful in the router's webui.

    Under LAN/DHCP Server I have:
    Code:
    MAC Address        IP Address          Hostname
    x:x:x:x:x:EE       192.168.1.102       gallipants
    
    I would now expect to be able to add another entry from the offline hosts in the drop-down mac address list:
    Code:
    x:x:x:x:x:06       192.168.1.102       gallipants
    
    ...but it throws an error "This entry has been in list", and will only allow a different ip address.


    Hopefully I've doing something dumb or have missed something obvious.
    Ill be very grateful if anyone can point out what it is.

    Phil
     
  2. JDB

    JDB Very Senior Member

    Joined:
    Aug 28, 2016
    Messages:
    843
  3. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,425
    Location:
    UK
    This is working as expected. The GUI will not let you reserve the same IP address for more than one MAC address.
     
    Vexira likes this.
  4. bananabrain

    bananabrain New Around Here

    Joined:
    Sep 15, 2019
    Messages:
    3
    I was a bit slow to realise your solution only works by first removing all references from the dhcp server config page - but it does work!

    Initially I had a merry dance trying to get my ethernet interface to let go of address .251, and ended up having to "service restart_dnsmasq", then uninstall the dhcpcd package on the laptop, delete all remnant files under /var and reinstall again (dhcpcd doesn't appear to provide a switch to clear its cache/leases).

    I'm very grateful to you.

    Phil
     
  5. bananabrain

    bananabrain New Around Here

    Joined:
    Sep 15, 2019
    Messages:
    3
    Yes Colin, that's self evident and I fully accept it. It does though rather smack of the latterday "no need to go trying to think things through for yourself, we know what's best for you". It's a pity the webui won't allow provision for a perfectly reasonable scenario that probably doesn't affect too many people.
    It's also a pity that the above solution results in the webui incorrectly advising of a "dhcp" connection rather than a forced "manual" one, which it effectively is.

    Don't misread me.
    No complaints here.
    This merlin firmware is a thing of beauty.

    Phil
     
  6. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    9,425
    Location:
    UK
    The webui is designed for "the average home user". For such users accidentally entering the same IP address for two different devices would be an error.

    As it stands the current interface is pretty simple to code, each line equates to a line in dnsmasq.conf. If you were to simply allow the user to enter duplicate IP addresses that wouldn't work because it would create two entries in dnsmasq.conf one of which would be ignored which prevents dnsmasq from starting up. So instead you would need more complicated code that scans the reservation list for duplicates and constructs lines like you have in your script. All in all this is just not worth the effort IMHO for an edge case like yours. Pro users can always use the script method.
     
    Last edited: Sep 15, 2019
    Vexira and L&LD like this.