You are not logged in.

#1 2019-05-30 08:17:10

Redostrike
Member
Registered: 2010-02-07
Posts: 37

[SOLVED] Static ip not working

Fresh install of arch. Has been a while since i touched linux.

I'm having some trouble with setting an Static ip.

When i set my machine (systemd network) to a static ip i can ping my local devices no problem, i can't ping my archbox from other machines though.
Also ping google dns is not working i cant get "online".

Everything works when i disable static ip and use DHCP.

config file enp3s0

 [Match]
name=enp3s0

[Network]
#DHCP=Yes
Address = 192.168.0.110/24
Gateway = 192.168.0.1
DNS = 8.8.8.8
DNS = 8.8.4.4

Last edited by Redostrike (2019-05-30 17:27:57)

Offline

#2 2019-05-30 09:54:48

Kartious
Member
From: UK
Registered: 2013-03-23
Posts: 311

Re: [SOLVED] Static ip not working

Just as a sanity check, have you followed this part of the Wiki ?

https://wiki.archlinux.org/index.php/Sy … n_examples


If you don't want DHCP at all then just remove the line from the file.

What did you name the config file? Where did you put it?

Define what you mean that you cant get online? You mean you can ping /access the router but not out the gateway ?

Offline

#3 2019-05-30 13:38:34

Redostrike
Member
Registered: 2010-02-07
Posts: 37

Re: [SOLVED] Static ip not working

Yes followed that part

file is called

/etc/systemd/network/enp3s0.network

# comments it out so that won't be the problem

I can ping other devices in the same network like my nas or windows box or gateway but not www.google.com or it's dns (8.8.8.8)

Last edited by Redostrike (2019-05-30 13:38:50)

Offline

#4 2019-05-30 13:48:10

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,500

Re: [SOLVED] Static ip not working

What's "ip a"/"ip r" for the dhcp case?

Offline

#5 2019-05-30 14:18:20

Redostrike
Member
Registered: 2010-02-07
Posts: 37

Re: [SOLVED] Static ip not working

ip a

1: lo: <LOOPBACK, UP, LOWER_UP> mtu 65536 qdisc noqueue state UKNOWN group default qlen 1000
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
     inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
     inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
     link/ether 80:ee:73:5a:95:6b brd ff:ff:ff:ff:ff:ff
     inet 192.168.0.176/24 brd 192.168.0.255 scope global dynamic enp3s0
         valid_lft 3256sec preferred_lft 3256sec
     inet6 2a02:1810:4e02:d800:82ee:73ff:fe5a:956b/64 scope global dynamic mngtmpaddr noprefixroute
         valid_lft 600575sec preferred_lft 82175sec
     inet6 fe80::82ee:73ff:fe5a:956b/64 scope link
         valid_lft forever preferred_lft forever

ip r

default via 192.168.0.1 dev enp3s0 proto dhcp src 192.168.0.176 metric 1024
192.168.0.0/24 dev enp3s0 proto kernel scope link src 192.168.0.176
192.168.0.1 dev enp3s0 proto dhcp scope link src 192.168.0.176 metric 1024

Offline

#6 2019-05-30 14:48:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,500

Re: [SOLVED] Static ip not working

There's nothing obviously off with this, compare the outputs (esp. the routing table and the "default via" entry) w/ the static config.

Offline

#7 2019-05-30 15:11:38

Redostrike
Member
Registered: 2010-02-07
Posts: 37

Re: [SOLVED] Static ip not working

Just as i thought nothing seems wrong but it's got to be something:

When using static there are some differences

ip a

1: lo: <LOOPBACK, UP, LOWER_UP> mtu 65536 qdisc noqueue state UKNOWN group default qlen 1000
     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
     inet 127.0.0.1/8 scope host lo
         valid_lft forever preferred_lft forever
     inet6 ::1/128 scope host
         valid_lft forever preferred_lft forever
2: enp3s0: <BROADCAST, MULTICAST, UP, LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
     link/ether 80:ee:73:5a:95:6b brd ff:ff:ff:ff:ff:ff
     inet 192.168.0.110/24 brd 192.168.0.255 scope global enp3s0
         valid_lft forever preferred_lft forever
     inet6 2a02:1810:4e02:d800:82ee:73ff:fe5a:956b/64 scope global dynamic mngtmpaddr noprefixroute
         valid_lft 597108sec preferred_lft 78708sec
     inet6 fe80::82ee:73ff:fe5a:956b/64 scope link
         valid_lft forever preferred_lft forever

ip r

default via 192.168.0.1 dev lo proto static
default via 192.168.0.1 dev enp3s0 proto static
192.168.0.0/24 dev enp3s0 proto kernel scope link src 192.168.0.110

Offline

#8 2019-05-30 15:35:29

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,500

Re: [SOLVED] Static ip not working

default via 192.168.0.1 dev lo proto static

Wtf?

ip route del default via 192.168.0.1 dev lo proto static

Offline

#9 2019-05-30 16:11:43

Redostrike
Member
Registered: 2010-02-07
Posts: 37

Re: [SOLVED] Static ip not working

Hmm thanks that seems to resolve the issue. Although on reboot it comes back? Any idea how to remove this?

edit: also can't seem to ping my arch box from my windows machine (but that might be another issue/config)

Last edited by Redostrike (2019-05-30 16:15:11)

Offline

#10 2019-05-30 16:21:08

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,500

Re: [SOLVED] Static ip not working

I don't even know how this can possibly show up there, lo and 192.168.0.1 are not in the same subnet and there's no bridge or whatever else shenanigan, so you should get an invalid gateway complaint.

What's the routing table before starting systemd-networkd?

(ftr, my default position on systemd-networkd is to not use it)

Edit: by ip or hostname?

Last edited by seth (2019-05-30 16:21:38)

Offline

#11 2019-05-30 16:27:32

Redostrike
Member
Registered: 2010-02-07
Posts: 37

Re: [SOLVED] Static ip not working

Without systemd-networkd service running ip r is empty nothing shows up.

I'm pinging my arch box via IP

might also ditch systemd-netword for my networking which one do you recommend?

Offline

#12 2019-05-30 16:31:07

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,500

Re: [SOLVED] Static ip not working

There's just one ethernet device => dhcpcd (yes, https://wiki.archlinux.org/index.php/Dh … ic_profile ) or netctl or a service that adds the interface and routes, https://wiki.archlinux.org/index.php/Ne … IP_address

Offline

#13 2019-05-30 17:27:34

Redostrike
Member
Registered: 2010-02-07
Posts: 37

Re: [SOLVED] Static ip not working

Yes dhcpcd works nothing special needed. ditching networkd

Thanks for your help.

Offline

#14 2019-05-30 19:34:45

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: [SOLVED] Static ip not working

Static addresses with systemd-networkd work just fine in my Debian buster system, do you see these lines in the journal if you try it again:

systemd-networkd-wait-online[2706]: ignoring: lo
systemd-networkd-wait-online[2706]: ignoring: lo
systemd-networkd-wait-online[2706]: ignoring: lo
systemd-networkd-wait-online[2706]: ignoring: lo

If this is a bug in the newer Arch version of systemd then I'm sure Lennart would like to know about it.


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB