sonic-buildimage/files/image_config/interfaces
Samuel Angebault 9bf4b0a93e
[baseimage]: Change the loopback mask from /8 to /16 (#5353)
As per the VOQ HLDs, internal networking between the linecards and supervisor is required within a chassis.
Allocating 127.X/16 subnets for private communication within a chassis is a good candidate.
It doesn't require any external IP allocation as well as ensure that the traffic will not leave the chassis.

References:
https://github.com/Azure/SONiC/pull/622
https://github.com/Azure/SONiC/pull/639

**- How I did it**

Changed the `interfaces.j2` file to add `127.0.0.1/16` as the `lo` ip address.
Then once the interface is up, the post-up command removes the `127.0.0.1/8` ip address.
The order in which the netmask change is made matters for `127.0.0.1` to be reachable at all times.

**- How to verify it**

```
root@sonic:~# ip address show dev lo
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 127.0.0.1/16 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
```

Co-authored-by: Baptiste Covolato <baptiste@arista.com>
2020-09-15 15:29:48 -07:00
..
init_interfaces [sonic boot] disable dhcp during boot up, until updategraph service is running (#2316) 2018-11-29 08:34:22 -08:00
interfaces-config.service Move all minigraph-related action from rc.local to updategraph (#1452) 2018-03-09 17:17:08 -08:00
interfaces-config.sh [interfaces] Reduce Calls to SONiC Cfggen (#5174) 2020-08-17 15:46:52 -07:00
interfaces.j2 [baseimage]: Change the loopback mask from /8 to /16 (#5353) 2020-09-15 15:29:48 -07:00