From 1bf1f06a216c0d703ef8fa018ee05e50fdb97c2e Mon Sep 17 00:00:00 2001 From: Jon-Olov Vatn Date: Fri, 15 Sep 2023 12:05:24 +0200 Subject: [PATCH 1/7] Updating infix-ip to clarify non-support deviations of ietf-ip Setting deviations of non-supported parts of ietf-ip Idea is that "pyang -f tree ietf-ip.yang infix-ip.yang" should show what we really support (and should make tests for). --- src/confd/confd-bootstrap.sh | 2 +- src/confd/yang/infix-ip@2023-04-24.yang | 47 --------- src/confd/yang/infix-ip@2023-09-14.yang | 131 ++++++++++++++++++++++++ 3 files changed, 132 insertions(+), 48 deletions(-) delete mode 100644 src/confd/yang/infix-ip@2023-04-24.yang create mode 100644 src/confd/yang/infix-ip@2023-09-14.yang diff --git a/src/confd/confd-bootstrap.sh b/src/confd/confd-bootstrap.sh index 2fadf71c..30964169 100755 --- a/src/confd/confd-bootstrap.sh +++ b/src/confd/confd-bootstrap.sh @@ -76,7 +76,7 @@ sysrepoctl -s $SEARCH \ -i ieee802-dot1q-types@2022-10-29.yang -g wheel -p 0660 \ -i ietf-if-vlan-encapsulation@2023-01-26.yang \ -g wheel -p 0660 \ - -i infix-ip@2023-04-24.yang -g wheel -p 0660 \ + -i infix-ip@2023-09-14.yang -g wheel -p 0660 \ -i infix-if-type@2023-08-21.yang -g wheel -p 0660 \ -i infix-interfaces@2023-09-19.yang -g wheel -p 0660 \ -e vlan-filtering \ diff --git a/src/confd/yang/infix-ip@2023-04-24.yang b/src/confd/yang/infix-ip@2023-04-24.yang deleted file mode 100644 index 663d8904..00000000 --- a/src/confd/yang/infix-ip@2023-04-24.yang +++ /dev/null @@ -1,47 +0,0 @@ -module infix-ip { - yang-version 1.1; - namespace "urn:infix:params:xml:ns:yang:infix-ip"; - prefix infix-ip; - - import ietf-interfaces { - prefix if; - } - import ietf-ip { - prefix ip; - } - import ietf-inet-types { - prefix inet; - } - import ietf-yang-types { - prefix yang; - } - - description - "This module augments ietf-ip with an IPv4 link-local autoconf"; - - revision 2023-04-24 { - description - "Initial revision."; - reference - "RFC 7277: A YANG Data Model for IP Management"; - } - - /* - * Data nodes - */ - augment "/if:interfaces/if:interface/ip:ipv4" { - container autoconf { - description - "Parameters to control the autoconfiguration of IPv4 address."; - - leaf enabled { - type boolean; - default false; - description - "Use a ZeroConf/IPv4LL agent to retrieve an 169.254/16 address."; - reference - "RFC 3927: Dynamic Configuration of IPv4 Link-Local Addresses"; - } - } - } -} diff --git a/src/confd/yang/infix-ip@2023-09-14.yang b/src/confd/yang/infix-ip@2023-09-14.yang new file mode 100644 index 00000000..ae5db0ec --- /dev/null +++ b/src/confd/yang/infix-ip@2023-09-14.yang @@ -0,0 +1,131 @@ +module infix-ip { + yang-version 1.1; + namespace "urn:infix:params:xml:ns:yang:infix-ip"; + prefix infix-ip; + + import ietf-interfaces { + prefix if; + } + import ietf-ip { + prefix ip; + } + import ietf-inet-types { + prefix inet; + } + import ietf-yang-types { + prefix yang; + } + + description + "This module augments ietf-ip with an IPv4 link-local autoconf"; + + revision 2023-09-14 { + description + "Added deviations for unsupported parts of ietf-ip."; + } + + revision 2023-04-24 { + description + "Initial revision."; + reference + "RFC 7277: A YANG Data Model for IP Management"; + } + + /* + * Data nodes + */ + augment "/if:interfaces/if:interface/ip:ipv4" { + container autoconf { + description + "Parameters to control the autoconfiguration of IPv4 address."; + + leaf enabled { + type boolean; + default false; + description + "Use a ZeroConf/IPv4LL agent to retrieve an 169.254/16 address."; + reference + "RFC 3927: Dynamic Configuration of IPv4 Link-Local Addresses"; + } + } + } + + deviation "/if:interfaces/if:interface/ip:ipv4/ip:address/ip:subnet/ip:netmask" { + deviate not-supported; + } + + deviation "/if:interfaces/if:interface/ip:ipv4/ip:address/ip:origin" { + deviate not-supported; + } + + deviation "/if:interfaces/if:interface/ip:ipv4/ip:neighbor/ip:origin" { + deviate not-supported; + } + + deviation "/if:interfaces/if:interface/ip:ipv6/ip:address/ip:origin" { + deviate not-supported; + } + + deviation "/if:interfaces/if:interface/ip:ipv6/ip:address/ip:status" { + deviate not-supported; + } + + deviation "/if:interfaces/if:interface/ip:ipv6/ip:neighbor/ip:origin" { + deviate not-supported; + } + + deviation "/if:interfaces/if:interface/ip:ipv6/ip:neighbor/ip:is-router" { + deviate not-supported; + } + + deviation "/if:interfaces/if:interface/ip:ipv6/ip:neighbor/ip:state" { + deviate not-supported; + } + + deviation "/if:interfaces/if:interface/ip:ipv6/ip:autoconf/ip:create-temporary-addresses" { + deviate not-supported; + } + + deviation "/if:interfaces/if:interface/ip:ipv6/ip:autoconf/ip:temporary-valid-lifetime" { + deviate not-supported; + } + + deviation "/if:interfaces/if:interface/ip:ipv6/ip:autoconf/ip:temporary-preferred-lifetime" { + deviate not-supported; + } + + deviation "/if:interfaces-state/if:interface/ip:ipv4/ip:forwarding" { + deviate not-supported; + } + + deviation "/if:interfaces-state/if:interface/ip:ipv4/ip:address/ip:subnet/ip:netmask" { + deviate not-supported; + } + + deviation "/if:interfaces-state/if:interface/ip:ipv4/ip:address/ip:origin" { + deviate not-supported; + } + + deviation "/if:interfaces-state/if:interface/ip:ipv4/ip:neighbor" { + deviate not-supported; + } + + deviation "/if:interfaces-state/if:interface/ip:ipv6/ip:forwarding" { + deviate not-supported; + } + + deviation "/if:interfaces-state/if:interface/ip:ipv6/ip:mtu" { + deviate not-supported; + } + + deviation "/if:interfaces-state/if:interface/ip:ipv6/ip:address" { + deviate not-supported; + } + + deviation "/if:interfaces-state/if:interface/ip:ipv6/ip:neighbor" { + deviate not-supported; + } + +} + + From 7c69926211044505c331f5409fc9674a9f570270 Mon Sep 17 00:00:00 2001 From: Jon-Olov Vatn Date: Fri, 15 Sep 2023 16:47:10 +0200 Subject: [PATCH 2/7] Adding draft doc on IP address configuration (user guide) Adding it in a dedicted directory for the user guide. Can be changed, of course. --- .../img/ip-address-example-ipv4-dhcp.svg | 566 +++++++ .../img/ip-address-example-ipv4-static.svg | 294 ++++ .../ip-address-example-ipv6-auto-global.svg | 507 ++++++ .../img/ip-address-example-ipv6-static.svg | 338 ++++ .../img/ip-address-example-switch.svg | 478 ++++++ doc/user-guide/img/ip-iface-examples.svg | 1381 +++++++++++++++++ doc/user-guide/ip-address.md | 172 ++ 7 files changed, 3736 insertions(+) create mode 100644 doc/user-guide/img/ip-address-example-ipv4-dhcp.svg create mode 100644 doc/user-guide/img/ip-address-example-ipv4-static.svg create mode 100644 doc/user-guide/img/ip-address-example-ipv6-auto-global.svg create mode 100644 doc/user-guide/img/ip-address-example-ipv6-static.svg create mode 100644 doc/user-guide/img/ip-address-example-switch.svg create mode 100644 doc/user-guide/img/ip-iface-examples.svg create mode 100644 doc/user-guide/ip-address.md diff --git a/doc/user-guide/img/ip-address-example-ipv4-dhcp.svg b/doc/user-guide/img/ip-address-example-ipv4-dhcp.svg new file mode 100644 index 00000000..37abee06 --- /dev/null +++ b/doc/user-guide/img/ip-address-example-ipv4-dhcp.svg @@ -0,0 +1,566 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/user-guide/img/ip-address-example-ipv4-static.svg b/doc/user-guide/img/ip-address-example-ipv4-static.svg new file mode 100644 index 00000000..ebbf00af --- /dev/null +++ b/doc/user-guide/img/ip-address-example-ipv4-static.svg @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/user-guide/img/ip-address-example-ipv6-auto-global.svg b/doc/user-guide/img/ip-address-example-ipv6-auto-global.svg new file mode 100644 index 00000000..41de4b87 --- /dev/null +++ b/doc/user-guide/img/ip-address-example-ipv6-auto-global.svg @@ -0,0 +1,507 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/user-guide/img/ip-address-example-ipv6-static.svg b/doc/user-guide/img/ip-address-example-ipv6-static.svg new file mode 100644 index 00000000..af05cd24 --- /dev/null +++ b/doc/user-guide/img/ip-address-example-ipv6-static.svg @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/user-guide/img/ip-address-example-switch.svg b/doc/user-guide/img/ip-address-example-switch.svg new file mode 100644 index 00000000..2de027f7 --- /dev/null +++ b/doc/user-guide/img/ip-address-example-switch.svg @@ -0,0 +1,478 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/user-guide/img/ip-iface-examples.svg b/doc/user-guide/img/ip-iface-examples.svg new file mode 100644 index 00000000..c72f5f04 --- /dev/null +++ b/doc/user-guide/img/ip-iface-examples.svg @@ -0,0 +1,1381 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/user-guide/ip-address.md b/doc/user-guide/ip-address.md new file mode 100644 index 00000000..1335447b --- /dev/null +++ b/doc/user-guide/ip-address.md @@ -0,0 +1,172 @@ +# IP Addresses And Other Per-Interface IP settings + +Infix supports several network interface types, and each can be +assigned one or more IP addresses. Both IPv4 and IPv6 are supported. + +![IP on top of network interface examples](img/ip-iface-examples.svg) + + +## IPv4 address assignment + +Multiple address assignment methods are available: + +| **Type** | **Yang Model** | **Description** | +|:-----------|:------------------|:---------------------------------------------------------------| +| static | ietf-ip | Static assignment of IPv4 address, e.g., *10.0.1.1/24* | +| link-local | infix-ip | Auto-assignment of IPv4 address in 169.254.x.x/16 range | +| dhcp | infix-dhcp-client | Assignment of IPv4 address by DHCP server, e.g., *10.0.1.1/24* | + + +DHCP address method is only available for *LAN* interfaces (ethernet, virtual ethernet (veth), bridge, etc.) + + +### Configuration examples + + +![Switch example (eth0 and lo)](img/ip-address-example-switch.svg) + + root@example:/> show interfaces + INTERFACE STATE PROTOCOL/ADDRESS SOURCE + lo up 00:00:00:00:00:00 unknown + 127.0.0.1/8 + + eth0 up 02:00:00:00:00:00 unknown + root@example:/> + +#### Configuring static IP and link-local IP addresses + +![Setting static IPv4 (and link-local IPv4)](img/ip-address-example-ipv4-static.svg) + + root@example:/> configure + root@example:/config/> edit interfaces interface eth0 ipv4 + root@example:/config/interfaces/interface/eth0/ipv4/> set address 10.0.1.1 prefix-length 24 + root@example:/config/interfaces/interface/eth0/ipv4/> set autoconf enabled true + root@example:/config/interfaces/interface/eth0/ipv4/> leave + root@example:/> show interfaces + INTERFACE STATE PROTOCOL/ADDRESS SOURCE + lo up 00:00:00:00:00:00 unknown + 127.0.0.1/8 + + eth0 up 02:00:00:00:00:00 unknown + 169.254.1.3/16 + 10.0.1.1/24 + + root@example:/> + +#### Use of DHCP for address assignment + +![Using DHCP for address assignment](img/ip-address-example-ipv4-dhcp.svg) + + root@example:/> configure + root@example:/config/> edit dhcp-client + root@example:/config/dhcp-client/> set client-if eth0 + root@example:/config/dhcp-client/> set enabled true + root@example:/config/dhcp-client/> leave + root@example:/> show interfaces + INTERFACE STATE PROTOCOL/ADDRESS SOURCE + lo up 00:00:00:00:00:00 unknown + 127.0.0.1/8 + + eth0 up 02:00:00:00:00:00 unknown + 10.1.2.100/24 + + root@example:/> + + +## IPv6 address assignment + +Multiple address assignment methods are available: + +| **Type** | **Yang Model** | **Description** | +|:-----------------|:---------------|:--------------------------------------------------------------------------------------------------------------------------------------------------| +| static | ietf-ip | Static assignment of IPv6 address, e.g., *2001:db8:0:1::1/64* | +| link-local | ietf-ip[^1] | (RFC4862) Auto-configured link-local IPv6 address (*fe80::0* prefix + interface identifier, e.g., *fe80::ccd2:82ff:fe52:728b/64*) | +| global auto-conf | ietf-ip | (RFC4862) Auto-configured (stateless) global IPv6 address (prefix from router + interface identifier, e.g., *2001:db8:0:1:ccd2:82ff:fe52:728b/64* | + + +[^1]: Link-local IPv6 addresses are implicitly enabled when enabling IPv6. IPv6 can be enabled/disabled per interface in *ietf-ip* YANG model. + + +### Example configurations + +![Switch example (eth0 and lo)](img/ip-address-example-switch.svg) + + root@infix-00-00-00:/> show ip + 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever + 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 + link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff + inet6 fe80::ff:fe00:0/64 scope link + valid_lft forever preferred_lft forever + root@infix-00-00-00:/> + +#### Disabling IPv6 link-local (disabling IPv6 on interface) + + root@infix-00-00-00:/> configure + root@infix-00-00-00:/config/> edit interfaces interface eth0 ipv6 + root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> set enabled false + root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> leave + root@infix-00-00-00:/> show ip + 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever + 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 + link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff + root@infix-00-00-00:/> + +#### Setting Static IPv6 address + +![Setting static IPv6](img/ip-address-example-ipv6-static.svg) + + root@infix-00-00-00:/> configure + root@infix-00-00-00:/config/> edit interfaces interface eth0 ipv6 + root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> set address 2001:db8::1 prefix-length 64 + root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> leave + root@infix-00-00-00:/> show ip + 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever + 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 + link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff + inet6 2001:db8::1/64 scope global + valid_lft forever preferred_lft forever + inet6 fe80::ff:fe00:0/64 scope link + valid_lft forever preferred_lft forever + root@infix-00-00-00:/> + +#### Stateless Autoconfiguration of Global IPv6 Address + +![Auto-configuration of global IPv6](img/ip-address-example-ipv6-auto-global.svg) + +Concatenation of prefix advertised by router (here 2001:db8:0:1::0/64) +and interface identifier. + + root@infix-00-00-00:/> configure + root@infix-00-00-00:/config/> edit interfaces interface eth0 ipv6 + root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> set address 2001:db8::1 prefix-length 64 + root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> leave + root@infix-00-00-00:/> show ip + 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever + 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 + link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff + inet6 2001:db8:0:1:0:ff:fe00:0/64 scope global dynamic mngtmpaddr + valid_lft 86398sec preferred_lft 14398sec + inet6 fe80::ff:fe00:0/64 scope link + valid_lft forever preferred_lft forever + root@infix-00-00-00:/> + From 76341750c0078e54e7efd6b97323108df1bc8462 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 21 Sep 2023 17:51:11 +0200 Subject: [PATCH 3/7] doc: relocate user-guide/* to . Like the Developer's Guide the User's Guide should be a single file on top-level (at least for now), where it references certain sections in other files. Signed-off-by: Joachim Wiberg --- .../img/ip-address-example-ipv4-dhcp.svg | 0 .../img/ip-address-example-ipv4-static.svg | 0 .../ip-address-example-ipv6-auto-global.svg | 0 .../img/ip-address-example-ipv6-static.svg | 0 .../img/ip-address-example-switch.svg | 0 .../img/ip-iface-examples.svg | 0 doc/networking.md | 174 ++++++++++++++++++ doc/user-guide/ip-address.md | 172 ----------------- 8 files changed, 174 insertions(+), 172 deletions(-) rename doc/{user-guide => }/img/ip-address-example-ipv4-dhcp.svg (100%) rename doc/{user-guide => }/img/ip-address-example-ipv4-static.svg (100%) rename doc/{user-guide => }/img/ip-address-example-ipv6-auto-global.svg (100%) rename doc/{user-guide => }/img/ip-address-example-ipv6-static.svg (100%) rename doc/{user-guide => }/img/ip-address-example-switch.svg (100%) rename doc/{user-guide => }/img/ip-iface-examples.svg (100%) delete mode 100644 doc/user-guide/ip-address.md diff --git a/doc/user-guide/img/ip-address-example-ipv4-dhcp.svg b/doc/img/ip-address-example-ipv4-dhcp.svg similarity index 100% rename from doc/user-guide/img/ip-address-example-ipv4-dhcp.svg rename to doc/img/ip-address-example-ipv4-dhcp.svg diff --git a/doc/user-guide/img/ip-address-example-ipv4-static.svg b/doc/img/ip-address-example-ipv4-static.svg similarity index 100% rename from doc/user-guide/img/ip-address-example-ipv4-static.svg rename to doc/img/ip-address-example-ipv4-static.svg diff --git a/doc/user-guide/img/ip-address-example-ipv6-auto-global.svg b/doc/img/ip-address-example-ipv6-auto-global.svg similarity index 100% rename from doc/user-guide/img/ip-address-example-ipv6-auto-global.svg rename to doc/img/ip-address-example-ipv6-auto-global.svg diff --git a/doc/user-guide/img/ip-address-example-ipv6-static.svg b/doc/img/ip-address-example-ipv6-static.svg similarity index 100% rename from doc/user-guide/img/ip-address-example-ipv6-static.svg rename to doc/img/ip-address-example-ipv6-static.svg diff --git a/doc/user-guide/img/ip-address-example-switch.svg b/doc/img/ip-address-example-switch.svg similarity index 100% rename from doc/user-guide/img/ip-address-example-switch.svg rename to doc/img/ip-address-example-switch.svg diff --git a/doc/user-guide/img/ip-iface-examples.svg b/doc/img/ip-iface-examples.svg similarity index 100% rename from doc/user-guide/img/ip-iface-examples.svg rename to doc/img/ip-iface-examples.svg diff --git a/doc/networking.md b/doc/networking.md index 2d17a191..96f042ec 100644 --- a/doc/networking.md +++ b/doc/networking.md @@ -37,3 +37,177 @@ a switching fabric into unique (isolated) ports, the full separation and virtualization of all Ethernet layer properties are possible to share with a container. Meaning, all the building blocks used on the left hand side can also be used freely on the right hand side as well. + + +# IP Addresses And Other Per-Interface IP settings + +Infix supports several network interface types, and each can be +assigned one or more IP addresses. Both IPv4 and IPv6 are supported. + +![IP on top of network interface examples](img/ip-iface-examples.svg) + + +## IPv4 address assignment + +Multiple address assignment methods are available: + +| **Type** | **Yang Model** | **Description** | +|:-----------|:------------------|:---------------------------------------------------------------| +| static | ietf-ip | Static assignment of IPv4 address, e.g., *10.0.1.1/24* | +| link-local | infix-ip | Auto-assignment of IPv4 address in 169.254.x.x/16 range | +| dhcp | infix-dhcp-client | Assignment of IPv4 address by DHCP server, e.g., *10.0.1.1/24* | + + +DHCP address method is only available for *LAN* interfaces (ethernet, virtual ethernet (veth), bridge, etc.) + + +### Configuration examples + + +![Switch example (eth0 and lo)](img/ip-address-example-switch.svg) + + root@example:/> show interfaces + INTERFACE STATE PROTOCOL/ADDRESS SOURCE + lo up 00:00:00:00:00:00 unknown + 127.0.0.1/8 + + eth0 up 02:00:00:00:00:00 unknown + root@example:/> + +#### Configuring static IP and link-local IP addresses + +![Setting static IPv4 (and link-local IPv4)](img/ip-address-example-ipv4-static.svg) + + root@example:/> configure + root@example:/config/> edit interfaces interface eth0 ipv4 + root@example:/config/interfaces/interface/eth0/ipv4/> set address 10.0.1.1 prefix-length 24 + root@example:/config/interfaces/interface/eth0/ipv4/> set autoconf enabled true + root@example:/config/interfaces/interface/eth0/ipv4/> leave + root@example:/> show interfaces + INTERFACE STATE PROTOCOL/ADDRESS SOURCE + lo up 00:00:00:00:00:00 unknown + 127.0.0.1/8 + + eth0 up 02:00:00:00:00:00 unknown + 169.254.1.3/16 + 10.0.1.1/24 + + root@example:/> + +#### Use of DHCP for address assignment + +![Using DHCP for address assignment](img/ip-address-example-ipv4-dhcp.svg) + + root@example:/> configure + root@example:/config/> edit dhcp-client + root@example:/config/dhcp-client/> set client-if eth0 + root@example:/config/dhcp-client/> set enabled true + root@example:/config/dhcp-client/> leave + root@example:/> show interfaces + INTERFACE STATE PROTOCOL/ADDRESS SOURCE + lo up 00:00:00:00:00:00 unknown + 127.0.0.1/8 + + eth0 up 02:00:00:00:00:00 unknown + 10.1.2.100/24 + + root@example:/> + + +## IPv6 address assignment + +Multiple address assignment methods are available: + +| **Type** | **Yang Model** | **Description** | +|:-----------------|:---------------|:--------------------------------------------------------------------------------------------------------------------------------------------------| +| static | ietf-ip | Static assignment of IPv6 address, e.g., *2001:db8:0:1::1/64* | +| link-local | ietf-ip[^1] | (RFC4862) Auto-configured link-local IPv6 address (*fe80::0* prefix + interface identifier, e.g., *fe80::ccd2:82ff:fe52:728b/64*) | +| global auto-conf | ietf-ip | (RFC4862) Auto-configured (stateless) global IPv6 address (prefix from router + interface identifier, e.g., *2001:db8:0:1:ccd2:82ff:fe52:728b/64* | + + +[^1]: Link-local IPv6 addresses are implicitly enabled when enabling IPv6. IPv6 can be enabled/disabled per interface in *ietf-ip* YANG model. + + +### Example configurations + +![Switch example (eth0 and lo)](img/ip-address-example-switch.svg) + + root@infix-00-00-00:/> show ip + 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever + 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 + link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff + inet6 fe80::ff:fe00:0/64 scope link + valid_lft forever preferred_lft forever + root@infix-00-00-00:/> + +#### Disabling IPv6 link-local (disabling IPv6 on interface) + + root@infix-00-00-00:/> configure + root@infix-00-00-00:/config/> edit interfaces interface eth0 ipv6 + root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> set enabled false + root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> leave + root@infix-00-00-00:/> show ip + 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever + 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 + link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff + root@infix-00-00-00:/> + +#### Setting Static IPv6 address + +![Setting static IPv6](img/ip-address-example-ipv6-static.svg) + + root@infix-00-00-00:/> configure + root@infix-00-00-00:/config/> edit interfaces interface eth0 ipv6 + root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> set address 2001:db8::1 prefix-length 64 + root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> leave + root@infix-00-00-00:/> show ip + 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever + 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 + link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff + inet6 2001:db8::1/64 scope global + valid_lft forever preferred_lft forever + inet6 fe80::ff:fe00:0/64 scope link + valid_lft forever preferred_lft forever + root@infix-00-00-00:/> + +#### Stateless Autoconfiguration of Global IPv6 Address + +![Auto-configuration of global IPv6](img/ip-address-example-ipv6-auto-global.svg) + +Concatenation of prefix advertised by router (here 2001:db8:0:1::0/64) +and interface identifier. + + root@infix-00-00-00:/> configure + root@infix-00-00-00:/config/> edit interfaces interface eth0 ipv6 + root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> set address 2001:db8::1 prefix-length 64 + root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> leave + root@infix-00-00-00:/> show ip + 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever + 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 + link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff + inet6 2001:db8:0:1:0:ff:fe00:0/64 scope global dynamic mngtmpaddr + valid_lft 86398sec preferred_lft 14398sec + inet6 fe80::ff:fe00:0/64 scope link + valid_lft forever preferred_lft forever + root@infix-00-00-00:/> + diff --git a/doc/user-guide/ip-address.md b/doc/user-guide/ip-address.md deleted file mode 100644 index 1335447b..00000000 --- a/doc/user-guide/ip-address.md +++ /dev/null @@ -1,172 +0,0 @@ -# IP Addresses And Other Per-Interface IP settings - -Infix supports several network interface types, and each can be -assigned one or more IP addresses. Both IPv4 and IPv6 are supported. - -![IP on top of network interface examples](img/ip-iface-examples.svg) - - -## IPv4 address assignment - -Multiple address assignment methods are available: - -| **Type** | **Yang Model** | **Description** | -|:-----------|:------------------|:---------------------------------------------------------------| -| static | ietf-ip | Static assignment of IPv4 address, e.g., *10.0.1.1/24* | -| link-local | infix-ip | Auto-assignment of IPv4 address in 169.254.x.x/16 range | -| dhcp | infix-dhcp-client | Assignment of IPv4 address by DHCP server, e.g., *10.0.1.1/24* | - - -DHCP address method is only available for *LAN* interfaces (ethernet, virtual ethernet (veth), bridge, etc.) - - -### Configuration examples - - -![Switch example (eth0 and lo)](img/ip-address-example-switch.svg) - - root@example:/> show interfaces - INTERFACE STATE PROTOCOL/ADDRESS SOURCE - lo up 00:00:00:00:00:00 unknown - 127.0.0.1/8 - - eth0 up 02:00:00:00:00:00 unknown - root@example:/> - -#### Configuring static IP and link-local IP addresses - -![Setting static IPv4 (and link-local IPv4)](img/ip-address-example-ipv4-static.svg) - - root@example:/> configure - root@example:/config/> edit interfaces interface eth0 ipv4 - root@example:/config/interfaces/interface/eth0/ipv4/> set address 10.0.1.1 prefix-length 24 - root@example:/config/interfaces/interface/eth0/ipv4/> set autoconf enabled true - root@example:/config/interfaces/interface/eth0/ipv4/> leave - root@example:/> show interfaces - INTERFACE STATE PROTOCOL/ADDRESS SOURCE - lo up 00:00:00:00:00:00 unknown - 127.0.0.1/8 - - eth0 up 02:00:00:00:00:00 unknown - 169.254.1.3/16 - 10.0.1.1/24 - - root@example:/> - -#### Use of DHCP for address assignment - -![Using DHCP for address assignment](img/ip-address-example-ipv4-dhcp.svg) - - root@example:/> configure - root@example:/config/> edit dhcp-client - root@example:/config/dhcp-client/> set client-if eth0 - root@example:/config/dhcp-client/> set enabled true - root@example:/config/dhcp-client/> leave - root@example:/> show interfaces - INTERFACE STATE PROTOCOL/ADDRESS SOURCE - lo up 00:00:00:00:00:00 unknown - 127.0.0.1/8 - - eth0 up 02:00:00:00:00:00 unknown - 10.1.2.100/24 - - root@example:/> - - -## IPv6 address assignment - -Multiple address assignment methods are available: - -| **Type** | **Yang Model** | **Description** | -|:-----------------|:---------------|:--------------------------------------------------------------------------------------------------------------------------------------------------| -| static | ietf-ip | Static assignment of IPv6 address, e.g., *2001:db8:0:1::1/64* | -| link-local | ietf-ip[^1] | (RFC4862) Auto-configured link-local IPv6 address (*fe80::0* prefix + interface identifier, e.g., *fe80::ccd2:82ff:fe52:728b/64*) | -| global auto-conf | ietf-ip | (RFC4862) Auto-configured (stateless) global IPv6 address (prefix from router + interface identifier, e.g., *2001:db8:0:1:ccd2:82ff:fe52:728b/64* | - - -[^1]: Link-local IPv6 addresses are implicitly enabled when enabling IPv6. IPv6 can be enabled/disabled per interface in *ietf-ip* YANG model. - - -### Example configurations - -![Switch example (eth0 and lo)](img/ip-address-example-switch.svg) - - root@infix-00-00-00:/> show ip - 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever - 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 - link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff - inet6 fe80::ff:fe00:0/64 scope link - valid_lft forever preferred_lft forever - root@infix-00-00-00:/> - -#### Disabling IPv6 link-local (disabling IPv6 on interface) - - root@infix-00-00-00:/> configure - root@infix-00-00-00:/config/> edit interfaces interface eth0 ipv6 - root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> set enabled false - root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> leave - root@infix-00-00-00:/> show ip - 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever - 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 - link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff - root@infix-00-00-00:/> - -#### Setting Static IPv6 address - -![Setting static IPv6](img/ip-address-example-ipv6-static.svg) - - root@infix-00-00-00:/> configure - root@infix-00-00-00:/config/> edit interfaces interface eth0 ipv6 - root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> set address 2001:db8::1 prefix-length 64 - root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> leave - root@infix-00-00-00:/> show ip - 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever - 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 - link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff - inet6 2001:db8::1/64 scope global - valid_lft forever preferred_lft forever - inet6 fe80::ff:fe00:0/64 scope link - valid_lft forever preferred_lft forever - root@infix-00-00-00:/> - -#### Stateless Autoconfiguration of Global IPv6 Address - -![Auto-configuration of global IPv6](img/ip-address-example-ipv6-auto-global.svg) - -Concatenation of prefix advertised by router (here 2001:db8:0:1::0/64) -and interface identifier. - - root@infix-00-00-00:/> configure - root@infix-00-00-00:/config/> edit interfaces interface eth0 ipv6 - root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> set address 2001:db8::1 prefix-length 64 - root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> leave - root@infix-00-00-00:/> show ip - 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever - 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 - link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff - inet6 2001:db8:0:1:0:ff:fe00:0/64 scope global dynamic mngtmpaddr - valid_lft 86398sec preferred_lft 14398sec - inet6 fe80::ff:fe00:0/64 scope link - valid_lft forever preferred_lft forever - root@infix-00-00-00:/> - From d014bc4b91f8e01e2ce1cb7ab848caf84e91c5a4 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 21 Sep 2023 19:26:06 +0200 Subject: [PATCH 4/7] doc: expand on data plane setup - expand on data plane setup - adjust headings - replace infix-00-00-00 with exmaple [skip ci] Signed-off-by: Joachim Wiberg --- doc/networking.md | 190 +++++++++++++++++++++++++++------------------- 1 file changed, 114 insertions(+), 76 deletions(-) diff --git a/doc/networking.md b/doc/networking.md index 96f042ec..ee4b91da 100644 --- a/doc/networking.md +++ b/doc/networking.md @@ -5,7 +5,7 @@ ![Linux Networking Blocks](img/lego.svg) | **Type** | **Yang Model** | **Description** | -|----------|-------------------|---------------------------------------------------------------| +| -------- | ----------------- | ------------------------------------------------------------- | | bridge | infix-if-bridge | SW implementation of an IEEE 802.1Q bridge | | ip | ietf-ip, infix-ip | IP address to the subordinate interface | | vlan | ietf-vlan-encap | Capture all traffic belonging to a specific 802.1Q VID | @@ -14,55 +14,92 @@ | eth | ietf-interfaces | Physical Ethernet device/port | | veth | infix-if-veth | Virtual Ethernet pair, typically one end is in a container | -[^1]: Please note, link aggregates are not yet supported in Infix. +## Data Plane -## Dataplane - -The blocks you choose, and how you connect them, defines your dataplane. -Here we see an example of how to bridge a virtual port with a physical -LAN. +The blocks you ctose, and how you connect them, defines your data plane. Here we see an example of how to bridge a virtual port with a physical LAN. ![Example of a 4-port switch with a link aggregate and a VETH pair to a container](img/dataplane.svg) -Depending on the (optional) VLAN filtering of the bridge, the container -may have full or limited connectivity with outside ports, as well as the -internal CPU. +Depending on the (optional) VLAN filtering of the bridge, the container may have full or limited connectivity with outside ports, as well as the internal CPU. -In fact the virtual port connected to the bridge can be member of -several VLANs, with each VLAN being an interface with an IP address -inside the container. +In fact the virtual port connected to the bridge can be member of several VLANs, with each VLAN being an interface with an IP address inside the container. -Thanks to Linux, and technologies like switchdev that allow you to split -a switching fabric into unique (isolated) ports, the full separation and -virtualization of all Ethernet layer properties are possible to share -with a container. Meaning, all the building blocks used on the left -hand side can also be used freely on the right hand side as well. +Thanks to Linux, and technologies like switchdev, that allow you to split a switching fabric into unique (isolated) ports, the full separation and virtualization of all Ethernet layer properties are possible to share with a container. Meaning, all the building blocks used on the left hand side can also be used freely on the right hand side as well. +### Bridging -# IP Addresses And Other Per-Interface IP settings +This is the most central part of the system. A bridge is a switch, and a switch is a bridge. In Linux, setting up a bridge with ports connected to physical switch fabric, means you manage the actual switch fabric! -Infix supports several network interface types, and each can be -assigned one or more IP addresses. Both IPv4 and IPv6 are supported. +In Infix ports are by default not switch ports, unless the customer specific factory config sets it up this way. To enable switching between ports you create a bridge and then add ports to that bridge. That's it. + +``` +admin@example:/> configure +admin@example:/config/> edit interfaces interface br0 +admin@example:/config/interfaces/interface/br0/> up +admin@example:/config/interfaces/> set interface eth0 bridge-port bridge br0 +admin@example:/config/interfaces/> set interface eth1 bridge-port bridge br0 +admin@example:/config/interfaces/> leave +``` + +Here we add two ports to bridge `br0`: `eth0` and `eth1`. + +> **Note:** Infix has many built-in helpers controlled by convention. E.g., if you name your bridge `brN`, where `N` is a number, Infix will set the interface type automatically for you, and unlock all bridge features for you. + +#### VLAN Filtering Bridge + +By default bridges in Linux do not filter based on VLAN tags. It can be enabled in Infix when creating a bridge by adding a port to a VLAN as a tagged or untagged member: + +``` +admin@example:/config/> edit interfaces interface br0 +admin@example:/config/interfaces/interface/br0/> up +admin@example:/config/interfaces/> set interface eth0 bridge-port bridge br0 +admin@example:/config/interfaces/> set interface eth1 bridge-port bridge br0 +admin@example:/config/interfaces/> edit interface br0 +admin@example:/config/interfaces/interface/br0/> set bridge vlans vlan 10 untagged eth0 +admin@example:/config/interfaces/interface/br0/> set bridge vlans vlan 20 untagged eth1 +``` + +This sets `eth0` as an untagged member of VLAN 10 and `eth1` as an +untagged member of VLAN 20. Switching between these ports is thus +prohibited. + +### VLAN Interfaces + +Creating a VLAN can be done in many ways. This section assumes VLAN interfaces created atop another Linux interface. E.g., the VLAN interfaces created on top of the bridge in the picture above. + +A VLAN interface is basically a filtering abstraction. When you run `tcpdump` on a VLAN interface you will only see the frames matching the VLAN ID of the interface, compared to *all* the VLAN IDs if you run `tcpdump` on the parent interface. + +``` +admin@example:/> configure +admin@example:/config/> edit interfaces interface eth0.20 +admin@example:/config/interfaces/interface/eth0.20/> set encapsulation dot1q-vlan outer-tag tag-type c-vlan vlan-id 20 +admin@example:/config/interfaces/interface/eth0.20/> set parent-interface eth0 +admin@example:/config/interfaces/interface/eth0.20/> leave +``` + +> **Note:** If you name your VLAN interface `foo0.N`, where `N` is a number, Infix will set the interface type automatically for you. + +## Management Plane + +This section details IP Addresses And Other Per-Interface IP settings. + +Infix support several network interface types, each can be assigned one or more IP addresses, both IPv4 and IPv6 are supported. ![IP on top of network interface examples](img/ip-iface-examples.svg) - -## IPv4 address assignment +### IPv4 Address Assignment Multiple address assignment methods are available: | **Type** | **Yang Model** | **Description** | -|:-----------|:------------------|:---------------------------------------------------------------| +|:---------- |:----------------- |:-------------------------------------------------------------- | | static | ietf-ip | Static assignment of IPv4 address, e.g., *10.0.1.1/24* | | link-local | infix-ip | Auto-assignment of IPv4 address in 169.254.x.x/16 range | | dhcp | infix-dhcp-client | Assignment of IPv4 address by DHCP server, e.g., *10.0.1.1/24* | - DHCP address method is only available for *LAN* interfaces (ethernet, virtual ethernet (veth), bridge, etc.) - -### Configuration examples - +#### Examples ![Switch example (eth0 and lo)](img/ip-address-example-switch.svg) @@ -70,11 +107,11 @@ DHCP address method is only available for *LAN* interfaces (ethernet, virtual et INTERFACE STATE PROTOCOL/ADDRESS SOURCE lo up 00:00:00:00:00:00 unknown 127.0.0.1/8 - + eth0 up 02:00:00:00:00:00 unknown root@example:/> -#### Configuring static IP and link-local IP addresses +##### Static IP and link-local IP addresses ![Setting static IPv4 (and link-local IPv4)](img/ip-address-example-ipv4-static.svg) @@ -87,14 +124,14 @@ DHCP address method is only available for *LAN* interfaces (ethernet, virtual et INTERFACE STATE PROTOCOL/ADDRESS SOURCE lo up 00:00:00:00:00:00 unknown 127.0.0.1/8 - + eth0 up 02:00:00:00:00:00 unknown 169.254.1.3/16 10.0.1.1/24 - + root@example:/> - -#### Use of DHCP for address assignment + +##### Use of DHCP for address assignment ![Using DHCP for address assignment](img/ip-address-example-ipv4-dhcp.svg) @@ -107,32 +144,27 @@ DHCP address method is only available for *LAN* interfaces (ethernet, virtual et INTERFACE STATE PROTOCOL/ADDRESS SOURCE lo up 00:00:00:00:00:00 unknown 127.0.0.1/8 - + eth0 up 02:00:00:00:00:00 unknown 10.1.2.100/24 - + root@example:/> - -## IPv6 address assignment +### IPv6 Address Assignment Multiple address assignment methods are available: | **Type** | **Yang Model** | **Description** | -|:-----------------|:---------------|:--------------------------------------------------------------------------------------------------------------------------------------------------| +|:---------------- |:-------------- |:------------------------------------------------------------------------------------------------------------------------------------------------- | | static | ietf-ip | Static assignment of IPv6 address, e.g., *2001:db8:0:1::1/64* | -| link-local | ietf-ip[^1] | (RFC4862) Auto-configured link-local IPv6 address (*fe80::0* prefix + interface identifier, e.g., *fe80::ccd2:82ff:fe52:728b/64*) | +| link-local | ietf-ip[^2] | (RFC4862) Auto-configured link-local IPv6 address (*fe80::0* prefix + interface identifier, e.g., *fe80::ccd2:82ff:fe52:728b/64*) | | global auto-conf | ietf-ip | (RFC4862) Auto-configured (stateless) global IPv6 address (prefix from router + interface identifier, e.g., *2001:db8:0:1:ccd2:82ff:fe52:728b/64* | - -[^1]: Link-local IPv6 addresses are implicitly enabled when enabling IPv6. IPv6 can be enabled/disabled per interface in *ietf-ip* YANG model. - - -### Example configurations +#### Examples ![Switch example (eth0 and lo)](img/ip-address-example-switch.svg) - root@infix-00-00-00:/> show ip + root@example:/> show ip 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo @@ -143,34 +175,38 @@ Multiple address assignment methods are available: link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff inet6 fe80::ff:fe00:0/64 scope link valid_lft forever preferred_lft forever - root@infix-00-00-00:/> + root@example:/> -#### Disabling IPv6 link-local (disabling IPv6 on interface) +##### Disabling IPv6 link-local address(es) - root@infix-00-00-00:/> configure - root@infix-00-00-00:/config/> edit interfaces interface eth0 ipv6 - root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> set enabled false - root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> leave - root@infix-00-00-00:/> show ip - 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 - link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 - inet 127.0.0.1/8 scope host lo - valid_lft forever preferred_lft forever - inet6 ::1/128 scope host - valid_lft forever preferred_lft forever - 2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 - link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff - root@infix-00-00-00:/> +The only way to disable IPv6 link-local addresses is by disabling IPv6 on the interface. -#### Setting Static IPv6 address +```(disabling +root@example:/> configure +root@example:/config/> edit interfaces interface eth0 ipv6 +root@example:/config/interfaces/interface/eth0/ipv6/> set enabled false +root@example:/config/interfaces/interface/eth0/ipv6/> leave +root@example:/> show ip +1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + inet 127.0.0.1/8 scope host lo + valid_lft forever preferred_lft forever + inet6 ::1/128 scope host + valid_lft forever preferred_lft forever +2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 + link/ether 02:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff +root@example:/> +``` + +##### Static IPv6 address ![Setting static IPv6](img/ip-address-example-ipv6-static.svg) - root@infix-00-00-00:/> configure - root@infix-00-00-00:/config/> edit interfaces interface eth0 ipv6 - root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> set address 2001:db8::1 prefix-length 64 - root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> leave - root@infix-00-00-00:/> show ip + root@example:/> configure + root@example:/config/> edit interfaces interface eth0 ipv6 + root@example:/config/interfaces/interface/eth0/ipv6/> set address 2001:db8::1 prefix-length 64 + root@example:/config/interfaces/interface/eth0/ipv6/> leave + root@example:/> show ip 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo @@ -183,20 +219,20 @@ Multiple address assignment methods are available: valid_lft forever preferred_lft forever inet6 fe80::ff:fe00:0/64 scope link valid_lft forever preferred_lft forever - root@infix-00-00-00:/> + root@example:/> -#### Stateless Autoconfiguration of Global IPv6 Address +##### Stateless Autoconfiguration of Global IPv6 Address ![Auto-configuration of global IPv6](img/ip-address-example-ipv6-auto-global.svg) Concatenation of prefix advertised by router (here 2001:db8:0:1::0/64) and interface identifier. - root@infix-00-00-00:/> configure - root@infix-00-00-00:/config/> edit interfaces interface eth0 ipv6 - root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> set address 2001:db8::1 prefix-length 64 - root@infix-00-00-00:/config/interfaces/interface/eth0/ipv6/> leave - root@infix-00-00-00:/> show ip + root@example:/> configure + root@example:/config/> edit interfaces interface eth0 ipv6 + root@example:/config/interfaces/interface/eth0/ipv6/> set address 2001:db8::1 prefix-length 64 + root@example:/config/interfaces/interface/eth0/ipv6/> leave + root@example:/> show ip 1: lo: mtu 65536 qdisc noqueue state UP group iface qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo @@ -209,5 +245,7 @@ and interface identifier. valid_lft 86398sec preferred_lft 14398sec inet6 fe80::ff:fe00:0/64 scope link valid_lft forever preferred_lft forever - root@infix-00-00-00:/> + root@example:/> +[^1]: Please note, link aggregates are not yet supported in Infix. +Link-local IPv6 addresses are implicitly enabled when enabling IPv6. IPv6 can be enabled/disabled per interface in *ietf-ip* YANG model. From 5d664fa055b78bd911eb55004f764b6b6ae00a87 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 21 Sep 2023 19:30:21 +0200 Subject: [PATCH 5/7] doc: relocate images to img/ Signed-off-by: Joachim Wiberg --- doc/{ => img}/testing-log.dot.svg | 0 doc/{ => img}/testing-overview.svg | 0 doc/{ => img}/testing-phy.dot.svg | 0 doc/testing.md | 6 +++--- 4 files changed, 3 insertions(+), 3 deletions(-) rename doc/{ => img}/testing-log.dot.svg (100%) rename doc/{ => img}/testing-overview.svg (100%) rename doc/{ => img}/testing-phy.dot.svg (100%) diff --git a/doc/testing-log.dot.svg b/doc/img/testing-log.dot.svg similarity index 100% rename from doc/testing-log.dot.svg rename to doc/img/testing-log.dot.svg diff --git a/doc/testing-overview.svg b/doc/img/testing-overview.svg similarity index 100% rename from doc/testing-overview.svg rename to doc/img/testing-overview.svg diff --git a/doc/testing-phy.dot.svg b/doc/img/testing-phy.dot.svg similarity index 100% rename from doc/testing-phy.dot.svg rename to doc/img/testing-phy.dot.svg diff --git a/doc/testing.md b/doc/testing.md index 760f8c5a..839d8d03 100644 --- a/doc/testing.md +++ b/doc/testing.md @@ -43,7 +43,7 @@ Tenets Architectural Overview ---------------------- -![Infix Testing Architecture](testing-overview.svg) +![Infix Testing Architecture](img/testing-overview.svg) The test system is made up of several independent components, which are typically used in concert to run a full test suite. @@ -140,7 +140,7 @@ DHCP server, and the other two as DHCP clients - with all three having a management connection to the host PC running the test. In other words, the test requires a _logical_ topology like the one below. -Example Logical Topology +Example Logical Topology ```dot graph "dhcp-client-server" { @@ -187,7 +187,7 @@ degrees), we can deploy well-known algorithms to find such subgraphs. Continuing our example, let's say we want to run our DHCP test on the _physical_ topology below. -Example Physical Topology +Example Physical Topology ```dot graph "quad-ring" { From 999d83ba8bcf8ade814b22e00534f8d7e9863f46 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 21 Sep 2023 19:39:18 +0200 Subject: [PATCH 6/7] confd: /if:interfaces-state is deprecated in IETF Signed-off-by: Joachim Wiberg --- src/confd/yang/infix-interfaces@2023-09-19.yang | 1 + 1 file changed, 1 insertion(+) diff --git a/src/confd/yang/infix-interfaces@2023-09-19.yang b/src/confd/yang/infix-interfaces@2023-09-19.yang index 6caf46d4..99c55ac4 100644 --- a/src/confd/yang/infix-interfaces@2023-09-19.yang +++ b/src/confd/yang/infix-interfaces@2023-09-19.yang @@ -59,5 +59,6 @@ module infix-interfaces { deviation "/if:interfaces-state" { deviate not-supported; + description "Deprecated"; } } From febf6c632d6527f7e6e1b60a48afcca309ce4372 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 21 Sep 2023 19:39:54 +0200 Subject: [PATCH 7/7] confd: simplify not-supported - drop origin since targeted at v23.09 - drop ipv6 temporary address deviations, fixed in #139 Signed-off-by: Joachim Wiberg --- src/confd/yang/infix-ip@2023-09-14.yang | 67 +------------------------ 1 file changed, 2 insertions(+), 65 deletions(-) diff --git a/src/confd/yang/infix-ip@2023-09-14.yang b/src/confd/yang/infix-ip@2023-09-14.yang index ae5db0ec..2cbd816b 100644 --- a/src/confd/yang/infix-ip@2023-09-14.yang +++ b/src/confd/yang/infix-ip@2023-09-14.yang @@ -54,78 +54,15 @@ module infix-ip { deviate not-supported; } - deviation "/if:interfaces/if:interface/ip:ipv4/ip:address/ip:origin" { - deviate not-supported; - } - - deviation "/if:interfaces/if:interface/ip:ipv4/ip:neighbor/ip:origin" { - deviate not-supported; - } - - deviation "/if:interfaces/if:interface/ip:ipv6/ip:address/ip:origin" { + deviation "/if:interfaces/if:interface/ip:ipv4/ip:neighbor" { deviate not-supported; } deviation "/if:interfaces/if:interface/ip:ipv6/ip:address/ip:status" { deviate not-supported; } - - deviation "/if:interfaces/if:interface/ip:ipv6/ip:neighbor/ip:origin" { - deviate not-supported; - } - - deviation "/if:interfaces/if:interface/ip:ipv6/ip:neighbor/ip:is-router" { - deviate not-supported; - } - deviation "/if:interfaces/if:interface/ip:ipv6/ip:neighbor/ip:state" { + deviation "/if:interfaces/if:interface/ip:ipv6/ip:neighbor" { deviate not-supported; } - - deviation "/if:interfaces/if:interface/ip:ipv6/ip:autoconf/ip:create-temporary-addresses" { - deviate not-supported; - } - - deviation "/if:interfaces/if:interface/ip:ipv6/ip:autoconf/ip:temporary-valid-lifetime" { - deviate not-supported; - } - - deviation "/if:interfaces/if:interface/ip:ipv6/ip:autoconf/ip:temporary-preferred-lifetime" { - deviate not-supported; - } - - deviation "/if:interfaces-state/if:interface/ip:ipv4/ip:forwarding" { - deviate not-supported; - } - - deviation "/if:interfaces-state/if:interface/ip:ipv4/ip:address/ip:subnet/ip:netmask" { - deviate not-supported; - } - - deviation "/if:interfaces-state/if:interface/ip:ipv4/ip:address/ip:origin" { - deviate not-supported; - } - - deviation "/if:interfaces-state/if:interface/ip:ipv4/ip:neighbor" { - deviate not-supported; - } - - deviation "/if:interfaces-state/if:interface/ip:ipv6/ip:forwarding" { - deviate not-supported; - } - - deviation "/if:interfaces-state/if:interface/ip:ipv6/ip:mtu" { - deviate not-supported; - } - - deviation "/if:interfaces-state/if:interface/ip:ipv6/ip:address" { - deviate not-supported; - } - - deviation "/if:interfaces-state/if:interface/ip:ipv6/ip:neighbor" { - deviate not-supported; - } - } - -