Article 5FA9K I broke my gateway ...

I broke my gateway ...

by
garyfritz
from LinuxQuestions.org on (#5FA9K)
I've been setting up several RHEL8 VMs. I built a checklist to remind myself of all the steps I need to do, and at first everything looked good. Got all the VMs set up, networking all worked like it was supposed to (with VM #n at 10.0.0.1n/16), and I did all my initial configs.

Then like an idiot, I decided to move the addresses, and I put VM #n at 10.1.1.n. Suddenly the external network became unavailable, e.g. "ping 8.8.8.8" got "Network is unreachable." Whoops, VM #1 is now on 10.1.1.1, did I stomp on the default gateway address? Or do I HAVE a gateway in this subnet? I'm not sure where the 10.0.0.1 gateway came from, probably my router, but I don't know what gateway to use in the 10.1.x.x subnet.

I tried moving to 10.0.1.n/16 and setting the gateway to 10.0.0.1, and that didn't work.

So I said fine, I'll move it back where it worked. I reverted to 10.0.0.1n/16, with no explicit gateway set, like it was originally. Any outside access STILL got "Network is unreachable." So I tried setting the gateway to 10.0.0.1, and that worked! But I didn't have an explicitly-set gateway before when it worked.

So I've got it working, but I'm confused. What did I break, why did it work with no explicit gateway at first and not after I broke it, and what gateway would I use in another subnet like 10.1.x.x?

Gary

Code:[ansible@node1 ~]$ ip a s enp0s3
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 08:00:27:80:4b:ba brd ff:ff:ff:ff:ff:ff
inet 10.0.0.11/16 brd 10.0.255.255 scope global noprefixroute enp0s3
valid_lft forever preferred_lft forever
inet6 fe80::95a9:61f3:a2cc:43f/64 scope link noprefixroute
valid_lft forever preferred_lft foreverCode:[root@node1 ansible]# nmcli con show enp0s3
ipv4.method: manual
ipv4.dns: --
ipv4.dns-search: --
ipv4.dns-options: --
ipv4.dns-priority: 0
ipv4.addresses: 10.0.0.11/16
ipv4.gateway: 10.0.0.1
ipv4.routes: --
ipv4.route-metric: -1
ipv4.route-table: 0 (unspec)
ipv4.routing-rules: --
ipv4.ignore-auto-routes: no
ipv4.ignore-auto-dns: no
ipv4.dhcp-client-id: --
ipv4.dhcp-iaid: --
ipv4.dhcp-timeout: 0 (default)
ipv4.dhcp-send-hostname: yes
ipv4.dhcp-hostname: --
ipv4.dhcp-fqdn: --
ipv4.dhcp-hostname-flags: 0x0 (none)
ipv4.never-default: no
ipv4.may-fail: yes
ipv4.dad-timeout: -1 (default)
ipv4.dhcp-vendor-class-identifier: --
ipv6.method: autolatest?d=yIl2AUoC8zA latest?i=EWsDBU1dytg:2p02pGeIqkM:F7zBnMy latest?i=EWsDBU1dytg:2p02pGeIqkM:V_sGLiP latest?d=qj6IDK7rITs latest?i=EWsDBU1dytg:2p02pGeIqkM:gIN9vFwEWsDBU1dytg
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments