Query about odd routing choices in Linux on Oracle Cloud


edit – i do know I’ve the route command incorrect in the principle physique of this.
I’ve tried

route add -net 192.168.0.0 netmask 255.255.192.0 gw 10.0.0.116

and the ip route get offers the expceted consequence now:

root@outpost:/house/george# ip route get 192.168.0.1
192.168.0.1 by way of 10.0.0.116 dev ens3 src 10.0.0.179 uid 0
    cache

however tracepath nonetheless goes the incorrect approach

root@outpost:/house/george# tracepath 192.168.10.1
 1?: [LOCALHOST]                      pmtu 9000
 1:  140.91.200.74                                         0.181ms asymm  2
 1:  140.91.200.79                                         0.181ms asymm  2
 2:  140.91.200.79                                         0.187ms pmtu 1500
 2:  oracle-svc071174-lag003319.ip.twelve99-cust.internet       0.456ms

I’ve 2 cases (linux, ubuntu) in Oracle cloud. One is arm primarily based, and one is x64 if that issues.

They’re


cloud - [10.0.0.116/24](https://10.0.0.116/24)

2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP group default qlen 1000

hyperlink/ether 02:00:17:17:55:4e brd ff:ff:ff:ff:ff:ff

inet [10.0.0.116/24](https://10.0.0.116/24) metric 100 brd [10.0.0.255](https://10.0.0.255) scope world enp0s3

valid_lft eternally preferred_lft eternally

inet6 fe80::17ff:fe17:554e/64 scope hyperlink

valid_lft eternally preferred_lft eternally

and


outpost - [10.0.0.179/24](https://10.0.0.179/24)

2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast state UP group default qlen 1000

hyperlink/ether 02:00:17:17:14:9d brd ff:ff:ff:ff:ff:ff

altname enp0s3

inet [10.0.0.179/24](https://10.0.0.179/24) metric 100 brd [10.0.0.255](https://10.0.0.255) scope world ens3

valid_lft eternally preferred_lft eternally

inet6 fe80::17ff:fe17:149d/64 scope hyperlink

valid_lft eternally preferred_lft eternally

I need site visitors on outpost directed to community 192.168.0.0/18 to be routed by way of cloud.

I’ve an analogous setup on my homelab, and it really works completely.

On outpost, i setup a route as follows:


route add -net 192.168.192.0 netmask 255.255.192.0 gw 10.0.0.116

which as anticipated ends in an ip route output of


default by way of [10.0.0.1](https://10.0.0.1) dev ens3 proto dhcp src [10.0.0.179](https://10.0.0.179) metric 100

[10.0.0.0/24](https://10.0.0.0/24) dev ens3 proto kernel scope hyperlink src [10.0.0.179](https://10.0.0.179) metric 100

[10.0.0.1](https://10.0.0.1) dev ens3 proto dhcp scope hyperlink src [10.0.0.179](https://10.0.0.179) metric 100

[169.254.169.254](https://169.254.169.254) by way of [10.0.0.1](https://10.0.0.1) dev ens3 proto dhcp src [10.0.0.179](https://10.0.0.179) metric 100

[192.168.192.0/18](https://192.168.192.0/18) by way of [10.0.0.116](https://10.0.0.116) dev ens3

but when I attempt to do a tracepath to a 192.168.0.0/18 tackle, it as a substitute routes to a totally completely different IP (which is in Oracles cloud):


george@outpost:~$ tracepath [192.168.10.1](https://192.168.10.1)

1?: [LOCALHOST]                      pmtu 9000

1:  [140.91.200.18](https://140.91.200.18)0.208ms asymm  2

1:  [140.91.200.79](https://140.91.200.79)0.171ms asymm  2

2:  [140.91.200.74](https://140.91.200.74)0.159ms pmtu 1500

2:  [oracle-svc071175-lag003322.ip.twelve99-cust.net](https://oracle-svc071175-lag003322.ip.twelve99-cust.internet)1.377ms

I’ve no clue the place its getting the 140.91.200.18 tackle from – its not in my routing desk, and if i’ve performed my sums accurately, it ought to go by way of the ten.0.0.116 gateway.


Checking the route with ip route offers

george@outpost:~$ ip route get [192.168.10.1](https://192.168.10.1)

[192.168.10.1](https://192.168.10.1) by way of [10.0.0.1](https://10.0.0.1) dev ens3 src [10.0.0.179](https://10.0.0.179) uid 1002

cache expires 512sec mtu 1500

so it’s going by way of 10.0.0.1 as a substitute of the static route I outlined.

I’ve this working effective in my homelab, with so far as I can inform precisely the identical setup.

I can’t for the lifetime of me determine why its sending it down the 10.0.0.1 interface quite than the one I outlined.

Any suggestions please?

thanks,

George

edit

oddly, if I alter the route command to do the entire /16 ip route get offers the anticipated output:

route add -net 192.168.0.0 netmask 255.255.0.0 gw 10.0.0.116

root@outpost:/house/george# ip route get 192.168.10.1
192.168.10.1 by way of 10.0.0.116 dev ens3 src 10.0.0.179 uid 0
    cache
root@outpost:/house/george#

nevertheless, tracepath nonetheless goes the ‘incorrect approach’:

root@outpost:/house/george# tracepath 192.168.10.1
 1?: [LOCALHOST]                      pmtu 9000
 1:  140.91.200.79                                         0.201ms asymm  2
 1:  140.91.200.23                                         0.141ms asymm  2
 2:  140.91.200.21                                         0.145ms pmtu 1500
 2:  oracle-svc071175-lag003322.ip.twelve99-cust.internet       1.147ms



Source_link

Leave a Reply

Your email address will not be published.