unofficial mirror of help-guix@gnu.org 
 help / color / Atom feed
* Re: How configure my desktop to use a static ip address?
       [not found] <87d062et82.fsf@gmail.com>
@ 2020-06-14 16:18 ` Kyle Andrews
  0 siblings, 0 replies; only message in thread
From: Kyle Andrews @ 2020-06-14 16:18 UTC (permalink / raw)
  To: help-guix


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?



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87d062et82.fsf@gmail.com>
2020-06-14 16:18 ` How configure my desktop to use a static ip address? Kyle Andrews

unofficial mirror of help-guix@gnu.org 

Archives are clonable:
	git clone --mirror https://yhetil.org/guix-user/0 guix-user/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-user guix-user/ https://yhetil.org/guix-user \
		help-guix@gnu.org
	public-inbox-index guix-user

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.user
	nntp://news.gmane.io/gmane.comp.gnu.guix.user


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git