Hi,
On Thu, May 16, 2019 at 8:43 PM Alex <mysqlstudent(a)gmail.com> wrote:
Hi,
> >> Typically NAME and DEVICE are the name of the device, like enp4s6,
> >> but they don't exist in this config. Is that what is missing?
> >
> > Doubtful.
> >
> > I have a system with a ifcfg-enp0s3 file and NAME=LAN-1 and
> > everthing works just fine.
>
> But "DEVICE=..." would have to be ""DEVICE=enp4s6" if the
NIC is
> "enp4s6", especially if there's no "HWADDR=...".
I've added DEVICE=enp4s6
> If you set "DEVICE=enp4s6" in "ifcfg-foo", "enp4s6"
will be configured
> and brought up. The ifcfg file name isn't used.
>
> If you set "NAME=bar", you can run "if{up,down} bar" and
"nmcli <cmd>
> ... bar", but "ip {l,a,r}" will display "enp4s6".
>
> If I have "enp4s6", I set "DEVICE=enp4s6" and
"NAME=enp4s6" in
> "ifcfg-enp4s6", so that everything corresponds and "ip a sh
enp4s6"
> and "nmcli c sh enp4s6" are possible and correspond to the same NIC.
I've also now added NAME=enp4s6, although I realize none of these
changes are likely to be effective here.
> Going back to OP's original query, do you have more than one NIC? Do
> their ifcfg files both have "DEFROUTE=yes"? What's the output of
"ip
> r" (or "route") before you run "route add default gw 192.168.9.1
dev
> enp4s6".
No, prior to running the network config, the
/etc/sysconfig/network-scripts directory was empty. After running it,
only that one file with interface info was created. There is another
interface on the system, but it is not configured.
I wish this was better documented, but it seems to change with every
release, even slightly.
For those following this thread, I rebooted the desktop remotely and
it came back successfully. For those not following, for some reason
after a fedora30 upgrade from fedora29, it did not properly add the
default route, making it impossible to connect to the system remotely
using ssh.
Here's the working config:
$ cat /etc/sysconfig/network-scripts/ifcfg-Wired_connection_2
HWADDR=00:0E:0C:3B:35:68
DEVICE=enp4s6
NAME=enp4s6
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
IPADDR=192.168.9.110
PREFIX=24
GATEWAY=192.168.9.1
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME="Wired connection 2"
UUID=850cde8f-7dc2-364a-8911-e511cdbea2e4
ONBOOT=yes
AUTOCONNECT_PRIORITY=-999
DNS1=167.206.112.138
DNS2=8.8.4.4
$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default _gateway 0.0.0.0 UG 100 0 0 enp4s6
192.168.9.0 0.0.0.0 255.255.255.0 U 100 0 0 enp4s6
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0