help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How configure my desktop to use a static ip address?


From: Kyle Andrews
Subject: Re: How configure my desktop to use a static ip address?
Date: Sun, 14 Jun 2020 12:18:58 -0400
User-agent: mu4e 1.4.6; emacs 26.3

Thanks to generous help from several people in the #guix IRC channel, I
learned that the trick I was missing was that I could actually use
Network Manager to setup a static IP once the router has been configured
to reserve it.  This generates a ~*.nmconnection~ configuration file
into:

: /etc/NetworkManager/system-connections

Then a simple-service etc-service can be added to the services list in
~/etc/config.scm~ to make that reproducible. I still need to figure out
exactly how to do that, but I have some leads.

guix-vits suggested that to simplify the generation of the configuration
file in /etc, I could store the file alongside ~/etc/config.scm~ and
reference it using some code like: 

  (define (cat-file path)
    (use-modules (ice-9 textual-ports))
    (with-input-from-file path (lambda _ (get-string-all 
(current-input-port)))))

  (define %nm-static-connection (cat-file 
"/etc/nm-static-profile.nmconnection"))

  (operating-system
    ...
    (services
        (cons*
           (simple-service 'nm-static-connection
                           etc-service-type
                 
`(("NetworkManager/system-connections/nm-static-profile.nmconnection"
                    ,%nm-static-connection))))
         ...))

I haven't tested it quite yet, but it makes some sense to me. If you
think this is not exactly the right approach, please let me
know.

Kyle Andrews writes:

> Dear Guix,
>
> I would like to setup my desktop computer so that I can easily
> synchronize it with my laptop via ssh and sshfs. Ideally, I would like
> to be able to do this from anywhere in the world behind
> e.g. AirVPN. However, honestly I know next to nothing about
> networking. So, I'm looking for guidance on how I can get there from
> here. Hopefully, you can help me and others who are looking to setup
> something similar.
>
> I've managed to setup the openssh-service which allows me to connect via
> SSH to my desktop on my local network if I go over to it and type ~ip
> address~ to learn the current IP address assigned to it. However,
> frequently I run into this scary message when trying to connect:
>
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
> @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
> IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
>
> While I have gotten into the routine of editing ~/.ssh/known_hosts and
> deleting the previous entry, I would like to resolve the issue for
> good. From my reading I think the best way to do that would be to set up
> a static IP for my desktop. I think to do that I need to . Do I need to 
> modify my /etc/config.scm to use
> static-networking-service? If so, how? Do I also need to modify my
> router configuration?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]