Default gateway doesn't work

Hi mates!
I’ve installed Tumbleweed and made network settings thgrough YaST. Set up static ip, DNS and route. And now I can’t connect to any source from internet.
This my ip settings:


# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 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: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether b4:7a:f1:36:54:28 brd ff:ff:ff:ff:ff:ff
    altname enp2s0f0
    inet 192.168.0.2/24 brd 192.168.0.255 scope global noprefixroute eno1
       valid_lft forever preferred_lft forever
    inet6 fe80::ee1f:8deb:c3cb:908d/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
3: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether b4:7a:f1:36:54:29 brd ff:ff:ff:ff:ff:ff
    altname enp2s0f1
4: eno3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether b4:7a:f1:36:54:2a brd ff:ff:ff:ff:ff:ff
    altname enp2s0f2
5: enp1s0f4u4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/ether f2:68:6d:32:74:a2 brd ff:ff:ff:ff:ff:ff
    inet 16.1.15.2/30 brd 16.1.15.3 scope global dynamic noprefixroute enp1s0f4u4
       valid_lft 8637695sec preferred_lft 8637695sec
    inet6 fe80::5113:f7bf:ef59:fdf8/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
6: eno4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether b4:7a:f1:36:54:2b brd ff:ff:ff:ff:ff:ff
    altname enp2s0f3

/etc/resolv.conf


search local
nameserver 192.168.0.1

/etc/sysconfig/network/routes

default 192.168.0.1 - -

And /etc/sysconfig/network/ifcfg-eno1

IPADDR='192.168.0.2/24'
BOOTPROTO='static'
STARTMODE='auto'

ip route


# ip route
16.1.15.0/30 dev enp1s0f4u4 proto kernel scope link src 16.1.15.2 metric 100
192.168.0.0/24 dev eno1 proto kernel scope link src 192.168.0.2 metric 101

And test internet connection:


# ping google.com
ping: connect: Network is unreachable

What am I doing wrong?

You did not define default route.

Where?

# cat /etc/sysconfig/network/routes
default 192.168.0.1 - -

Default route already setup

Hi
Define the route interface, eg eno1

You mean like this?

default 192.168.0.1 - eno1

Hi
Yes, then should see it in the output of ip route as well as a file ifroute-eno1.

Right, I missed it, sorry. You have the second interface, how is it configured? I guess by DHCP? Does DHCP server for this interface provide default gateway? What happens if you uncheck “change default route via DHCP” in global options? Show ifcfg file for this interface too.

That’s not necessary, interface is auto-detected.

Only one interface connected to LAN cable - it’s eno1.
I have eno1 config file only


# ls -l /etc/sysconfig/network
total 56
-rw-r--r-- 1 root root  8137 May  3 19:28 config
-rw-r--r-- 1 root root  8984 May  3 19:28 dhcp
-rw-r--r-- 1 root root    60 May  3 19:59 ifcfg-eno1
-rw------- 1 root root   147 May  3 19:28 ifcfg-lo
-rw-r--r-- 1 root root 21738 Feb 20 06:34 ifcfg.template
drwxr-xr-x 1 root root     0 Mar  9 22:00 if-down.d
drwxr-xr-x 1 root root     0 Mar  9 22:00 if-up.d
drwx------ 1 root root     0 Mar  9 22:00 providers
-rw-r--r-- 1 root root    25 May  3 20:40 routes
drwxr-xr-x 1 root root    76 May  3 19:26 scripts

No effect. After reboot no default route

# ip route
16.1.15.0/30 dev enp1s0f4u4 proto kernel scope link src 16.1.15.2 metric 100
192.168.0.0/24 dev eno1 proto kernel scope link src 192.168.0.2 metric 101

So what is this?

Where the address comes from?

Judging by “noprefixroute” it may be NetworkManager …

It’s iLO virtual NIC. I have HP microserver Gen 10. So, I don’t sure that this device can accure the problem with default gateway.

May be. How this device gets IP address? It is not configured in YaST/wicked.

I dind’t configure it. It’s internal address in iLO configuration from bios. And I don’t have GUI Yast, “server” install option with minimal packet list.
Also if I add default gateway, it’s works before reboot

# ip route add default via 192.168.0.1
localhost:/home/user# ip route
default via 192.168.0.1 dev eno1
16.1.15.0/30 dev enp1s0f4u4 proto kernel scope link src 16.1.15.2 metric 100
192.168.0.0/24 dev eno1 proto kernel scope link src 192.168.0.2 metric 101

Found solution.
I’ve enabled wicked service and my default route starts works fine after reboot. But now I have duplicate routes


# wicked ifstatus all
eno1            up
      link:     #2, state up, mtu 1500
      type:     ethernet, hwaddr b4:7a:f1:36:54:28
      config:   compat:suse:/etc/sysconfig/network/ifcfg-eno1
      leases:   ipv4 static granted
      addr:     ipv4 192.168.0.2/24 [static]
      route:    ipv4 default via 192.168.0.1 proto boot
      route:    ipv4 default via 192.168.0.1 metric 20101 proto static

Hi
On my system /eetc/sysconfig/network/routes is zero bytes, maybe you have a route in there?

Yes, I have:

# ll /etc/sysconfig/network/routes
-rw-r--r-- 1 root root 25 May  3 20:40 /etc/sysconfig/network/routes

And


# cat /etc/sysconfig/network/routes
default 192.168.0.1 - -

Hi
You should also have a ifroute-eno1 file as well, zero out the routes file so has no contents.

Why? YaST creates /etc/sysconfig/network/routes. Do you imply this is a bug?

Hi
On my system it’s empty, YaST created (in my case) ifroute-eth2.


ls /etc/sysconfig/network/
config  dhcp  if-down.d  if-up.d  ifcfg-br0  ifcfg-br1  ifcfg-eth0  ifcfg-eth1  ifcfg-eth2  ifcfg-eth3  ifcfg-eth4  ifcfg-lo  ifcfg.template  ifroute-eth2  providers  routes  scripts

cat /etc/sysconfig/network/routes 

cat /etc/sysconfig/network/ifroute-eth2 
default 192.168.10.1 - eth2 

wicked ifstatus eth2
eth2            up
      link:     #4, state up, mtu 1500
      type:     ethernet, hwaddr 00:0a:cd:24:d2:d3
      config:   compat:suse:/etc/sysconfig/network/ifcfg-eth2
      leases:   ipv4 static granted
      addr:     ipv4 192.168.10.50/24 [static]
      route:    ipv4 default via 192.168.10.1 proto boot

And on my system YaST created …/routes. Which one is bigger?

Hi
My ifroute-eth2…


 ls -la /etc/sysconfig/network/*rout*
-rw-r--r-- 1 root root 29 Jan 24 20:24 /etc/sysconfig/network/ifroute-eth2
-rw-r--r-- 1 root root  0 Jan 24 20:24 /etc/sysconfig/network/routes

I see the same on Leap 15.3 using wicked.