I have a network set up with an address with a /22, however I only appear to be able to route traffic via the gateway within the /24.
# incus network show private
config:
bridge.mtu: "1300"
dns.nameservers: 10.4.0.14
ipv4.address: 10.4.0.1/22
ipv4.dhcp.routes: 0.0.0.0/0,10.4.0.1
ipv4.nat: "true"
ipv6.address: none
network: UPLINK
volatile.network.ipv4.address: 192.168.1.16
Addresses are allocated by DHCP from 10.4.0.2 upwards and generally work fine. So I’d like to allocate a static of 10.5.0.10 to an instance on this network. Should be Ok as it’s within the routed range (?) So my first test instance using DHCP looks like this;
# ip a|grep global|cut -c1-22
inet 10.4.0.17/22
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.4.0.1 0.0.0.0 UG 1024 0 0 eth0
10.4.0.0 0.0.0.0 255.255.252.0 U 1024 0 0 eth0
10.4.0.1 0.0.0.0 255.255.255.255 UH 1024 0 0 eth0
10.4.0.14 0.0.0.0 255.255.255.255 UH 1024 0 0 eth0
My second instance I set up with a static IP address looks like this;
# ip a|grep global|cut -c1-22
inet 10.5.0.10/22
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.4.0.1 0.0.0.0 UG 0 0 0 eth0
10.5.0.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0
My initial expectation is that they can ping each other - they cannot, when routing to the 10.5 via the gateway it pushes traffic out of the default route.
# traceroute -n 10.5.0.10
traceroute to 10.5.0.10 (10.5.0.10), 30 hops max, 60 byte packets
1 10.4.0.1 1.982 ms 2.030 ms 2.097 ms
2 192.168.1.254 3.487 ms 3.745 ms 3.460 ms^C
Kinda looks like the netmask on the gateway set up at 10.4.0.1 is a /24 rather than a /22. Just to confirm a gateway issue, if I add a static route to both sides;
node A:
ip route add 10.5.0.0/24 dev eth0
node B:
ip route add 10.4.0.0/24 dev eth0
..
# traceroute -n 10.5.0.10
traceroute to 10.5.0.10 (10.5.0.10), 30 hops max, 60 byte packets
1 10.5.0.10 1.952 ms 1.899 ms 1.884 ms
The overall problem being, node B on 10.5 can’t see or get to the gateway on 10.4.0.1, hence it can’t route to other networks over the OVN-IC (as it has no access to a gateway).
Any idea what I’m doing wrong?