unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Kyle Andrews <kyle.c.andrews@gmail.com>
To: help-guix <help-guix@gnu.org>
Subject: Re: How configure my desktop to use a static ip address?
Date: Sun, 14 Jun 2020 12:18:58 -0400	[thread overview]
Message-ID: <878sgpei31.fsf@gmail.com> (raw)
In-Reply-To: <87d062et82.fsf@gmail.com>


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	other threads:[~2020-06-14 16:19 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <87d062et82.fsf@gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878sgpei31.fsf@gmail.com \
    --to=kyle.c.andrews@gmail.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).