Changing Static IP and /etc/hosts file

  • Folks,


    I changed the IP structure on my network due to security flaws with most home routers. Went from 192.168.1.x to 10.x.x.x No DHCP just static IP's for OMV.


    All went well and the OMV change went well - on the working system. I forgot to change the new box I'm building. No problem though the program OMV-Firstaid worked. Thank you Volker!


    What I did find though is the /etc/hosts file last line entry of;


    192.168.1.12 servername.local servername


    had not changed to the new assigned IP of;


    10.11.12.13


    (not the actual IP) it was still as the 192 entry. I reviewed the Network settings/options and they were correct. So I used nano and edited the /etc/hosts file to reflect the correct IP. No problems.


    I also checked the /etc/hosts file on the working box and had the same issues. Edited there as well.


    So this leads me to think that when a change is made to the static IP either through the network settings of the GUI or through OMV-Firstaid they are not updating the /etc/hosts file.


    Do not know if it is a problem or not. But figure if it was pointing to the original static IP it should point to the new static IP.

    • Offizieller Beitrag

    OMV doesn't put the ip address in the /etc/hosts file even with a static ip. You should have the 127.0.0.1 and 127.0.1.1 entries but those are just for localhost. You should also have the name but not IP address. So, there shouldn't be a problem. Not sure how your ip address ended up in the hosts file.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • ryecoaaron


    I had not fully read the top of the hosts file and noticed that the server was at 127.0.0.1 and since the hosts file is read from top to bottom and the first one gets precedence the one I edited would not get used. So even with that I # commented the edited line, and will see what happens.


    Though I do not know how it got there either as I had not edited the hosts file before on either machine. Just out of curiosity have you looked at the hosts file on your machines?


    @tekkbebe


    I've heard of DD-WRT and looked at it, though it is time to revisit it as I believe my router is supported. Yet in the back of my mind I don't want to brick it. So I've been looking at pfsense. Now if OMV and pfsense could coexist in the same box.......


    [EDIT] Found out Buffalo's WZR-300HP router has DD-WRT installed from the factory and they are less than $60.00 from Amazon. Will have to read through the DD-WRT manuals.

    • Offizieller Beitrag
    Zitat von "DaveVM"

    Just out of curiosity have you looked at the hosts file on your machines?


    I looked at all of them. I even setup a fresh virtual machine to see if I could get it to add the ip address anywhere in the hosts file. I wasn't able to.


    If you need help with dd-wrt, I can help too. Been using it for a long time.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Well I must have done something then to the hosts files, though for the life of me I don't know what. Because they had their original static IP's. Chalk it up to an intellectual intermission.


    Appreciate the offer of help with DD-WRT. My Netgear WNR-3500L will support it. Though it is now several years old, so I'm looking at an upgrade and will probably go with their WNDR4300 as it too is DD-WRT capable. Like to keep my net connection alive while I set up another router.

    • Offizieller Beitrag

    I've used dd-wrt on a WNR-3500L (my home router). Hopefully, you have a v1. If you are going to buy a new router, I would buy a broadcom based router because they are supported by more third party firmwares. The Asus RT-N66U is incredible and supports tomato by shibby as well as dd-wrt. I have 301 days of uptime on mine at work which is how many days ago I purchased it.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • OK. I was finally able to duplicate the original issue.


    Went to the NETWORK - GENERAL tab and changed the Hostname and the Domain Name.


    Hostname of: server
    Domain Name of: local


    Clicked on OK and then SSH'ed into the system and used NANO to view the /etc/hosts file. And there it was!


    Code
    10.1.2.3  server.local   server


    So the GUI of OMV will change the /etc/hosts file to add it's IP, Hostname and Domain Name, while OMV-Firstaid and a fresh OMV install does not. So it raises the question of what if any problems are created by this.


    I've thought about this and did some more reading. Still trying to understand it but read about how avahi uses/provides the DNS Service Discovery (mDNS/DNS-SD) which can be found in the SMB/CIFS section. avahi has it's own hosts file at /etc/avahi/hosts Yet it requires it's entries to be like;


    10.1.2.3 server.local


    with the TLD being local as is in the man pages for avahi. And an OMV entry is not in the /etc/avahi/hosts file. Now is it because if a TLD other than local were used it would break some other OMV functionality?


    I might be all wrong here with my thoughts.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!