Laptop wifi & lan connection different IPs. How to reach either wifi or ethernet?

Hi I have laptop and it has wifi interface & network. In my /etc/config/dhcp

config host                                      
        option name 'laptope'  #ethernet
        option dns '1'                           
        option mac 'xx:xx:xx:xx:xx:01'           
        option ip '192.168.1.11'                      
                                                     
config host                                          
        option name 'laptopw'  #wifi                     
        option dns '1'                               
        option mac 'xx:xx:xx:xx:xx:02'               
        option ip '192.168.1.12'

so now I can reach it either laptope or laptopw depending on the way I connected. Is there a way to make a single name laptop which will be used for both so that I don't need to think about the way I connected to network?

Yes, and no.

config host                                      
        option name 'laptop'
        option dns '1'                           
        option mac 'xx:xx:xx:xx:xx:01 xx:xx:xx:xx:xx:02'           
        option ip '192.168.1.10'  

would be valid (and is working), but you'd have to ensure that at no time at all wlan and ethernet are both connected at the same time, which is not quite an option in practice.

4 Likes
1 Like

I have tested it works ok when connected both, the first MAC in the list gets used. I did setup for Network interface to be first and quite happy with that.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.