This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/src/sonic-config-engine
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
..
data [config-engine]: Add admin_status up to l2switch.json template (#3210) 2019-07-24 09:45:24 -07:00
tests [baseimage]: Change the loopback mask from /8 to /16 (#5353) 2020-09-15 15:29:48 -07:00
.gitignore [sonic-config-engine] Update .gitignore (#5223) 2020-08-20 11:09:10 -07:00
config_samples.py [cfggen] Conform With Python 3 Syntax (#5154) 2020-08-19 09:29:40 -07:00
lazy_re.py [sonic-cfggen] optimize sonic-cfggen startup (#3658) 2019-10-31 09:17:29 -07:00
MANIFEST.in [config/acl] Support everflow config translation (#468) 2017-04-07 01:10:05 -07:00
minigraph.py [cfggen] Conform With Python 3 Syntax (#5154) 2020-08-19 09:29:40 -07:00
openconfig_acl.py [cfggen] Conform With Python 3 Syntax (#5154) 2020-08-19 09:29:40 -07:00
portconfig.py [sonic-utilities][sonic-py-common] Move logic to get port config file path to sonic-py-common and update sonic-utilities to comply (#5264) 2020-09-04 10:19:12 -07:00
redis_bcc.py [sonic-cfggen] optimize sonic-cfggen startup (#3658) 2019-10-31 09:17:29 -07:00
setup.py [cfggen] Conform With Python 3 Syntax (#5154) 2020-08-19 09:29:40 -07:00
sonic-cfggen [sonic-utilities][sonic-py-common] Move logic to get port config file path to sonic-py-common and update sonic-utilities to comply (#5264) 2020-09-04 10:19:12 -07:00