Saturday, 12 September 2020

TIL checking your routing tables on Ubuntu

 So, in the past, I've used tools such as ifconfig and route and netstat, but TIL something new ...

I was trying to debug a networking problem with a container running on one of my Secure Service Container (SSC) instances on an IBM z14.

Whilst the container was creating, networking was more like notworking.

Via direct access to the SSC, I could open a shell inside the running container, and poke about within its internals.

Whilst it had an IP address, as per:

ip address

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 scope host lo

       valid_lft forever preferred_lft forever

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

    link/ether e2:3d:3e:bb:d0:81 brd ff:ff:ff:ff:ff:ff

    inet brd scope global eth0

       valid_lft forever preferred_lft forever

and a DNS configuration: -

cat /etc/resolv.conf

# Generated by RunQ


I wasn't able to ping the outside world, whether or anything else.

I suspect the routing table, but didn't have netstat or route installed and, of course, without internet access could not install them using apt-get update && apt-get install -y 

So what to do ?

At this point, I discovered ip route which goes alongside ip address as per this: -

ip route

default via dev eth0 dev eth0 proto kernel scope link src 

This (a) showed the routing table and (b more importantly, showed me what I was doing wrong ....

This was the WRONG subnet.

Without going down a rabbit hole, the Docker network that the SSC was using was WRONG :-(

Once I sorted this out, all was well ....

And ip route is now in the kitbag......

No comments:

Today I Learned - more about Git config

Whilst trying to create a container image from a project on GitHub, I hit an issue with the cloning process of the GH repository ... Specifi...