You are not logged in.

#1 2021-01-25 01:01:59

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

[SOLVED] Can't figure out to set up static IP

Dear all smile

This is on a new install, where I have created /etc/systemd/network/20-wired.network and it contains

[Match]
Name=enp0s25

[Network]
Address=192.168.1.10/16
Gateway=192.168.0.1
DNS=192.168.0.1

and doing

systemctl systemd-networkd
ip a

shows I have got the IP, but I can't "ping google.com". I get "Network is unreachable".

Can anyone figure out what I am doing wrong?

Hugs
Sandra smile

Last edited by LittleSandra (2021-01-26 19:42:00)

Offline

#2 2021-01-25 01:13:00

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Can't figure out to set up static IP

You need to set up systemd-resolved as well.
https://wiki.archlinux.org/index.php/Sy … _and_setup


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2021-01-25 01:55:05

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,674

Re: [SOLVED] Can't figure out to set up static IP

Does it work any better if you set

Address=192.168.0.10/16

Offline

#4 2021-01-25 02:04:56

twobooks
Member
From: rainforest
Registered: 2020-06-23
Posts: 47

Re: [SOLVED] Can't figure out to set up static IP

boot from archiso, copy your DNS server from /etc/resolv.conf
boot your newly installed system, you need to install netctl package
there is an example /etc/netctl/examples/ethernet-static,
copy it to /etc/netctl/enp0s25, you need the following lines
Interface=enp0s25
Connection=ethernet
IP=static
Address=('192.168.0.21/24' '192.168.7.21/24')
Gateway='192.168.0.1'
DNS=('164.9.44.117') <= specify your DNS server

then execute,
nectl enable enp0s25
netctl start enp0s25

Last edited by twobooks (2021-01-25 02:07:51)

Offline

#5 2021-01-25 02:05:57

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [SOLVED] Can't figure out to set up static IP

Post the output of `ip a s` and `ip r s`, and `ping -c1 192.168.0.1`

Offline

#6 2021-01-25 06:49:40

Archlin
Member
Registered: 2018-05-09
Posts: 67

Re: [SOLVED] Can't figure out to set up static IP

That you have an ip is logical since you set it yourself, but when it does not communicate with your router/modem it still will fail.
The reason for that seems that your gateway and dns don't comply with the ip you did set. They are on complete different networks ranges (x168.0.x vs x168.1.x)

Offline

#7 2021-01-25 10:10:50

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: [SOLVED] Can't figure out to set up static IP

@archlin Look at the subnet. They are in the same range when using a /16. Not everything is a /24 network.

Offline

#8 2021-01-25 11:15:41

Archlin
Member
Registered: 2018-05-09
Posts: 67

Re: [SOLVED] Can't figure out to set up static IP

Your right overlooked that.

Offline

#9 2021-01-26 19:29:19

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

Re: [SOLVED] Can't figure out to set up static IP

twobooks wrote:

boot from archiso, copy your DNS server from /etc/resolv.conf
boot your newly installed system, you need to install netctl package
there is an example /etc/netctl/examples/ethernet-static,
copy it to /etc/netctl/enp0s25, you need the following lines
Interface=enp0s25
Connection=ethernet
IP=static
Address=('192.168.0.21/24' '192.168.7.21/24')
Gateway='192.168.0.1'
DNS=('164.9.44.117') <= specify your DNS server

then execute,
nectl enable enp0s25
netctl start enp0s25

This worked for me smile Thanks so much! smile

I don't understand however why I cant have

Address=('192.168.1.21/16')

I would argue, that it just allows me to connect to ip addresses from 192.168.0.1 - 192.168.255.255. I guess that isn't the case, so if anyone can explain why, then I would be very interested in knowing smile

Hugs
Sandra smile

Offline

#10 2021-01-26 20:55:15

twobooks
Member
From: rainforest
Registered: 2020-06-23
Posts: 47

Re: [SOLVED] Can't figure out to set up static IP

theoretically, Address=('192.168.1.21/16') is OK,
however for LAN at home  Address=('192.168.0.21/24') is preferred because there are 254 addresses available and that is enough; for LAN in the office Address=('192.168.1.21/16') is still not recommended for security reason, you don't want the staffs in the marketing department to share information with the employees in the accounting department.

Offline

Board footer

Powered by FluxBB