Some of my instances are deployed with code into its /etc/rc.local
#!/bin/sh
# Managed by puppet - do not modify
/sbin/route del default
/sbin/route add default gw 11.0.0.254
All works fine at the beginning but after a few minutes the gateway changes to default value (11.0.0.1)
I think this is happening only recently.
Why is that? How can I change it?
More info:
Immediately after the boot. The instance route table looks like this...
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 11.0.0.254 0.0.0.0 UG 0 0 0 ens5
11.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens5
11.0.0.1 0.0.0.0 255.255.255.255 UH 100 0 0 ens5
After a while, looks like this.. (and of course, lost internet access)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 11.0.0.1 0.0.0.0 UG 0 0 0 ens5
11.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens5
11.0.0.1 0.0.0.0 255.255.255.255 UH 100 0 0 ens5
If I change the route table manually. After a while it looks like this...
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 11.0.0.254 0.0.0.0 UG 0 0 0 ens5
0.0.0.0 11.0.0.1 0.0.0.0 UG 100 0 0 ens5
11.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 ens5
11.0.0.1 0.0.0.0 255.255.255.255 UH 100 0 0 ens5
Internet access works but I don't like this unasked change and I don't like this manually repair since these instances are in an Auto Scaling Group.