Compare commits
7 commits
077f1877e8
...
bcc495ae4a
| Author | SHA1 | Date | |
|---|---|---|---|
|
bcc495ae4a |
|||
|
679d2073f8 |
|||
|
385ee9d1f0 |
|||
|
350a1dd82f |
|||
|
4effb5028a |
|||
|
d51359d4f2 |
|||
|
ee7ecbf69f |
20 changed files with 15 additions and 166 deletions
|
|
@ -30,9 +30,8 @@ Dans le netns du VPC de l'interface, sur l'hôte de la VM :
|
||||||
* un ``macvlan`` ``fip-<IP publique en hexadécimal>`` (``203.0.113.20`` → ``fip-cb007114``) sur
|
* un ``macvlan`` ``fip-<IP publique en hexadécimal>`` (``203.0.113.20`` → ``fip-cb007114``) sur
|
||||||
le bridge ``br-public`` du netns. Sa MAC est ``02:05`` suivi des quatre octets de l'IP publique
|
le bridge ``br-public`` du netns. Sa MAC est ``02:05`` suivi des quatre octets de l'IP publique
|
||||||
(``02:05:cb:00:71:14``) : unique dans l'infrastructure, la même sur tout hôte ;
|
(``02:05:cb:00:71:14``) : unique dans l'infrastructure, la même sur tout hôte ;
|
||||||
* une entrée FDB locale de cette MAC, posée par remplacement (le bridge a pu l'apprendre sur le
|
* une entrée FDB locale de cette MAC, et ``arp_ignore=1``, ``arp_announce=2``, ``arp_notify=1``,
|
||||||
segment tant que l'IP flottante vivait sur un autre hôte), et ``arp_ignore=1``,
|
comme pour la :doc:`passerelle NAT <passerelle-nat>` ;
|
||||||
``arp_announce=2``, ``arp_notify=1``, comme pour la :doc:`passerelle NAT <passerelle-nat>` ;
|
|
||||||
* deux chaînes dans la table nftables ``ip two`` :
|
* deux chaînes dans la table nftables ``ip two`` :
|
||||||
|
|
||||||
* ``pre-fip-…``, en ``prerouting`` à la priorité ``raw`` : ce qui arrive par ``fip-…`` vers
|
* ``pre-fip-…``, en ``prerouting`` à la priorité ``raw`` : ce qui arrive par ``fip-…`` vers
|
||||||
|
|
|
||||||
|
|
@ -44,9 +44,7 @@ Dans le netns du VPC ``vp-<id>``, sur l'hôte de la passerelle :
|
||||||
même quel que soit l'hôte : c'est ce qui permet de déplacer la passerelle ;
|
même quel que soit l'hôte : c'est ce qui permet de déplacer la passerelle ;
|
||||||
* une entrée FDB locale de cette MAC sur ``br-public`` : un ``macvlan`` n'en crée pas dans son
|
* une entrée FDB locale de cette MAC sur ``br-public`` : un ``macvlan`` n'en crée pas dans son
|
||||||
bridge parent, et sans elle les trames vers la passerelle seraient inondées au lieu de lui être
|
bridge parent, et sans elle les trames vers la passerelle seraient inondées au lieu de lui être
|
||||||
remises (même mécanisme que la MAC anycast des subnets ``vxlan``). Elle est posée par
|
remises (même mécanisme que la MAC anycast des subnets ``vxlan``) ;
|
||||||
remplacement : après une bascule, le bridge a appris cette MAC sur le segment, vers l'ancien
|
|
||||||
hôte ;
|
|
||||||
* ``arp_ignore=1``, ``arp_announce=2`` et ``arp_notify=1`` sur ``ng-<id>`` : la passerelle ne
|
* ``arp_ignore=1``, ``arp_announce=2`` et ``arp_notify=1`` sur ``ng-<id>`` : la passerelle ne
|
||||||
répond à l'ARP que pour son IP de sortie, et annonce celle-ci par un ARP gratuit à sa mise en
|
répond à l'ARP que pour son IP de sortie, et annonce celle-ci par un ARP gratuit à sa mise en
|
||||||
route ;
|
route ;
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,6 @@ public est celui de ``interfaces.internet``, ``br-public`` si la clé est absent
|
||||||
accroche ``vxlan-public``, le VXLAN du segment public partagé avec les bordures
|
accroche ``vxlan-public``, le VXLAN du segment public partagé avec les bordures
|
||||||
(:doc:`/demarrage/installation`) ; sans ce bridge, toute création de VPC échoue.
|
(:doc:`/demarrage/installation`) ; sans ce bridge, toute création de VPC échoue.
|
||||||
|
|
||||||
Le ``br-public`` du netns n'est qu'un point de raccordement : rien n'entre dans le VPC par lui.
|
|
||||||
L'agent y pose ``arp_ignore=1`` (il ne répond pas à l'ARP pour les adresses du netns) et, dans la
|
|
||||||
table nftables ``ip two``, rejette tout IP arrivé par ``br-public`` (chaînes ``in-br-public`` et
|
|
||||||
``fwd-br-public``). Seules les interfaces publiques prévues — passerelle NAT, IP flottante — y
|
|
||||||
reçoivent du trafic. Il désactive aussi ``br_netfilter`` dans le netns
|
|
||||||
(``net.bridge.bridge-nf-call-{iptables,ip6tables,arptables}=0``, quand le module est chargé) : sinon
|
|
||||||
conntrack voit chaque trame pontée et le SNAT de la passerelle NAT ne s'applique plus.
|
|
||||||
|
|
||||||
Dans le netns, l'agent pose aussi la ``dummy`` ``hostsvc`` (``169.254.169.253/32``) et la chaîne
|
Dans le netns, l'agent pose aussi la ``dummy`` ``hostsvc`` (``169.254.169.253/32``) et la chaîne
|
||||||
iptables ``TWO-HOSTSVC``, puis demande à ``two-hostsvc`` de servir le VPC : c'est le chemin du
|
iptables ``TWO-HOSTSVC``, puis demande à ``two-hostsvc`` de servir le VPC : c'est le chemin du
|
||||||
DNS et du NTP des VM (voir :doc:`dns-ntp`). Si ``two-hostsvc`` ne répond pas, la création du VPC
|
DNS et du NTP des VM (voir :doc:`dns-ntp`). Si ``two-hostsvc`` ne répond pas, la création du VPC
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ func create(h host, f floatingIP) error {
|
||||||
rules := nft.FloatingIP{Iface: f.iface, Public: f.public.IP.String(), Private: f.private.String()}
|
rules := nft.FloatingIP{Iface: f.iface, Public: f.public.IP.String(), Private: f.private.String()}
|
||||||
steps := []step{
|
steps := []step{
|
||||||
{"create " + f.iface, func() error { return h.CreateMacvlan(ns, f.iface, publicBridge, f.mac) }},
|
{"create " + f.iface, func() error { return h.CreateMacvlan(ns, f.iface, publicBridge, f.mac) }},
|
||||||
{"local fdb entry " + f.mac.String(), func() error { return h.BridgeSetLocalMAC(ns, publicBridge, f.mac) }},
|
{"local fdb entry " + f.mac.String(), func() error { return h.BridgeAddLocalMAC(ns, publicBridge, f.mac) }},
|
||||||
}
|
}
|
||||||
for _, sc := range sysctls(f.iface) {
|
for _, sc := range sysctls(f.iface) {
|
||||||
steps = append(steps, step{sc[0], func() error { return h.Sysctl(ns, sc[0], sc[1]) }})
|
steps = append(steps, step{sc[0], func() error { return h.Sysctl(ns, sc[0], sc[1]) }})
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ func (f *fakeHost) CreateMacvlan(ns, name, parent string, mac net.HardwareAddr)
|
||||||
return f.record(fmt.Sprintf("macvlan [%s] %s parent %s mac %s", ns, name, parent, mac))
|
return f.record(fmt.Sprintf("macvlan [%s] %s parent %s mac %s", ns, name, parent, mac))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *fakeHost) BridgeSetLocalMAC(ns, bridge string, mac net.HardwareAddr) error {
|
func (f *fakeHost) BridgeAddLocalMAC(ns, bridge string, mac net.HardwareAddr) error {
|
||||||
return f.record(fmt.Sprintf("fdb add [%s] %s %s", ns, bridge, mac))
|
return f.record(fmt.Sprintf("fdb add [%s] %s %s", ns, bridge, mac))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
type host interface {
|
type host interface {
|
||||||
CreateMacvlan(ns, name, parent string, mac net.HardwareAddr) error
|
CreateMacvlan(ns, name, parent string, mac net.HardwareAddr) error
|
||||||
BridgeSetLocalMAC(ns, bridge string, mac net.HardwareAddr) error
|
BridgeAddLocalMAC(ns, bridge string, mac net.HardwareAddr) error
|
||||||
BridgeDelLocalMAC(ns, bridge string, mac net.HardwareAddr) error
|
BridgeDelLocalMAC(ns, bridge string, mac net.HardwareAddr) error
|
||||||
Sysctl(ns, key, value string) error
|
Sysctl(ns, key, value string) error
|
||||||
SetFloatingIP(ns string, f nft.FloatingIP) error
|
SetFloatingIP(ns string, f nft.FloatingIP) error
|
||||||
|
|
@ -33,8 +33,8 @@ func (system) CreateMacvlan(ns, name, parent string, mac net.HardwareAddr) error
|
||||||
return netns.Call(ns, func() error { return netif.CreateMacvlan(name, parent, mac) })
|
return netns.Call(ns, func() error { return netif.CreateMacvlan(name, parent, mac) })
|
||||||
}
|
}
|
||||||
|
|
||||||
func (system) BridgeSetLocalMAC(ns, bridge string, mac net.HardwareAddr) error {
|
func (system) BridgeAddLocalMAC(ns, bridge string, mac net.HardwareAddr) error {
|
||||||
return netns.Call(ns, func() error { return netif.BridgeSetLocalMAC(bridge, mac) })
|
return netns.Call(ns, func() error { return netif.BridgeAddLocalMAC(bridge, mac) })
|
||||||
}
|
}
|
||||||
|
|
||||||
func (system) BridgeDelLocalMAC(ns, bridge string, mac net.HardwareAddr) error {
|
func (system) BridgeDelLocalMAC(ns, bridge string, mac net.HardwareAddr) error {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import (
|
||||||
|
|
||||||
type host interface {
|
type host interface {
|
||||||
CreateMacvlan(ns, name, parent string, mac net.HardwareAddr) error
|
CreateMacvlan(ns, name, parent string, mac net.HardwareAddr) error
|
||||||
BridgeSetLocalMAC(ns, bridge string, mac net.HardwareAddr) error
|
BridgeAddLocalMAC(ns, bridge string, mac net.HardwareAddr) error
|
||||||
BridgeDelLocalMAC(ns, bridge string, mac net.HardwareAddr) error
|
BridgeDelLocalMAC(ns, bridge string, mac net.HardwareAddr) error
|
||||||
Sysctl(ns, key, value string) error
|
Sysctl(ns, key, value string) error
|
||||||
AddrAdd(ns, iface string, prefix *net.IPNet) error
|
AddrAdd(ns, iface string, prefix *net.IPNet) error
|
||||||
|
|
@ -42,8 +42,8 @@ func (system) CreateMacvlan(ns, name, parent string, mac net.HardwareAddr) error
|
||||||
return netns.Call(ns, func() error { return netif.CreateMacvlan(name, parent, mac) })
|
return netns.Call(ns, func() error { return netif.CreateMacvlan(name, parent, mac) })
|
||||||
}
|
}
|
||||||
|
|
||||||
func (system) BridgeSetLocalMAC(ns, bridge string, mac net.HardwareAddr) error {
|
func (system) BridgeAddLocalMAC(ns, bridge string, mac net.HardwareAddr) error {
|
||||||
return netns.Call(ns, func() error { return netif.BridgeSetLocalMAC(bridge, mac) })
|
return netns.Call(ns, func() error { return netif.BridgeAddLocalMAC(bridge, mac) })
|
||||||
}
|
}
|
||||||
|
|
||||||
func (system) BridgeDelLocalMAC(ns, bridge string, mac net.HardwareAddr) error {
|
func (system) BridgeDelLocalMAC(ns, bridge string, mac net.HardwareAddr) error {
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ func create(h host, g gateway) error {
|
||||||
ns := g.vpc
|
ns := g.vpc
|
||||||
steps := []step{
|
steps := []step{
|
||||||
{"create " + g.iface, func() error { return h.CreateMacvlan(ns, g.iface, publicBridge, g.mac) }},
|
{"create " + g.iface, func() error { return h.CreateMacvlan(ns, g.iface, publicBridge, g.mac) }},
|
||||||
{"local fdb entry " + g.mac.String(), func() error { return h.BridgeSetLocalMAC(ns, publicBridge, g.mac) }},
|
{"local fdb entry " + g.mac.String(), func() error { return h.BridgeAddLocalMAC(ns, publicBridge, g.mac) }},
|
||||||
}
|
}
|
||||||
for _, kv := range sysctls(g.iface) {
|
for _, kv := range sysctls(g.iface) {
|
||||||
steps = append(steps, step{kv[0], func() error { return h.Sysctl(ns, kv[0], kv[1]) }})
|
steps = append(steps, step{kv[0], func() error { return h.Sysctl(ns, kv[0], kv[1]) }})
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ func (f *fakeHost) CreateMacvlan(ns, name, parent string, mac net.HardwareAddr)
|
||||||
return f.record(fmt.Sprintf("macvlan [%s] %s parent %s mac %s", ns, name, parent, mac))
|
return f.record(fmt.Sprintf("macvlan [%s] %s parent %s mac %s", ns, name, parent, mac))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *fakeHost) BridgeSetLocalMAC(ns, bridge string, mac net.HardwareAddr) error {
|
func (f *fakeHost) BridgeAddLocalMAC(ns, bridge string, mac net.HardwareAddr) error {
|
||||||
return f.record(fmt.Sprintf("fdb add [%s] %s %s", ns, bridge, mac))
|
return f.record(fmt.Sprintf("fdb add [%s] %s %s", ns, bridge, mac))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,14 +39,6 @@ func BridgeAddLocalMAC(bridge string, mac net.HardwareAddr) error {
|
||||||
return netlink.NeighAdd(bridgeLocalEntry(link.Attrs().Index, mac))
|
return netlink.NeighAdd(bridgeLocalEntry(link.Attrs().Index, mac))
|
||||||
}
|
}
|
||||||
|
|
||||||
func BridgeSetLocalMAC(bridge string, mac net.HardwareAddr) error {
|
|
||||||
link, err := netlink.LinkByName(bridge)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return netlink.NeighSet(bridgeLocalEntry(link.Attrs().Index, mac))
|
|
||||||
}
|
|
||||||
|
|
||||||
func BridgeHasLocalMAC(bridge string, mac net.HardwareAddr) (bool, error) {
|
func BridgeHasLocalMAC(bridge string, mac net.HardwareAddr) (bool, error) {
|
||||||
link, err := netlink.LinkByName(bridge)
|
link, err := netlink.LinkByName(bridge)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,3 @@ func BridgeHasLocalMAC(_ string, _ net.HardwareAddr) (bool, error) {
|
||||||
func BridgeDelLocalMACIfExists(_ string, _ net.HardwareAddr) error {
|
func BridgeDelLocalMACIfExists(_ string, _ net.HardwareAddr) error {
|
||||||
return errors.New("not supported on this platform")
|
return errors.New("not supported on this platform")
|
||||||
}
|
}
|
||||||
|
|
||||||
func BridgeSetLocalMAC(_ string, _ net.HardwareAddr) error {
|
|
||||||
return errors.New("not supported on this platform")
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
package nft
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
var guardChains = []natChain{
|
|
||||||
{"in-", "filter", "input", "filter"},
|
|
||||||
{"fwd-", "filter", "forward", "filter"},
|
|
||||||
}
|
|
||||||
|
|
||||||
func guardScript(bridge string) string {
|
|
||||||
var b strings.Builder
|
|
||||||
fmt.Fprintf(&b, "add table ip %s\n", Table)
|
|
||||||
for _, c := range guardChains {
|
|
||||||
name := c.declare(&b, bridge)
|
|
||||||
fmt.Fprintf(&b, "add rule ip %s %s iifname %q drop\n", Table, name, bridge)
|
|
||||||
}
|
|
||||||
return b.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func SetBridgeGuard(bridge string) error {
|
|
||||||
if err := apply(guardScript(bridge)); err != nil {
|
|
||||||
return fmt.Errorf("guard %s: %w", bridge, err)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
package nft
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
func TestGuardScript(t *testing.T) {
|
|
||||||
want := `add table ip two
|
|
||||||
add chain ip two in-br-public { type filter hook input priority filter; policy accept; }
|
|
||||||
flush chain ip two in-br-public
|
|
||||||
add rule ip two in-br-public iifname "br-public" drop
|
|
||||||
add chain ip two fwd-br-public { type filter hook forward priority filter; policy accept; }
|
|
||||||
flush chain ip two fwd-br-public
|
|
||||||
add rule ip two fwd-br-public iifname "br-public" drop
|
|
||||||
`
|
|
||||||
if got := guardScript("br-public"); got != want {
|
|
||||||
t.Errorf("script :\n%s\nattendu :\n%s", got, want)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
package sysctl
|
package sysctl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/fs"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -23,13 +21,3 @@ func Set(key, value string) error {
|
||||||
}
|
}
|
||||||
return f.Close()
|
return f.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetIfPresent(key, value string) (bool, error) {
|
|
||||||
path := filepath.Join(root, strings.ReplaceAll(key, ".", "/"))
|
|
||||||
if _, err := os.Stat(path); errors.Is(err, fs.ErrNotExist) {
|
|
||||||
return false, nil
|
|
||||||
} else if err != nil {
|
|
||||||
return false, fmt.Errorf("sysctl %s: %w", key, err)
|
|
||||||
}
|
|
||||||
return true, Set(key, value)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -46,25 +46,3 @@ func TestSetRefusesAnUnknownKeyWithoutCreatingIt(t *testing.T) {
|
||||||
t.Errorf("clé inconnue créée : %v", err)
|
t.Errorf("clé inconnue créée : %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSetIfPresentSkipsAnAbsentKey(t *testing.T) {
|
|
||||||
dir := fakeRoot(t)
|
|
||||||
set, err := SetIfPresent("net.bridge.bridge-nf-call-iptables", "0")
|
|
||||||
if err != nil || set {
|
|
||||||
t.Errorf("clé absente : %v, %v ; false, nil attendus", set, err)
|
|
||||||
}
|
|
||||||
if _, err := os.Stat(filepath.Join(dir, "net", "bridge")); err == nil {
|
|
||||||
t.Error("répertoire créé pour une clé absente")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestSetIfPresentWritesAPresentKey(t *testing.T) {
|
|
||||||
dir := fakeRoot(t)
|
|
||||||
set, err := SetIfPresent("net.ipv4.ip_forward", "1")
|
|
||||||
if err != nil || !set {
|
|
||||||
t.Fatalf("clé présente : %v, %v", set, err)
|
|
||||||
}
|
|
||||||
if got, _ := os.ReadFile(filepath.Join(dir, "net", "ipv4", "ip_forward")); string(got) != "1" {
|
|
||||||
t.Errorf("contenu %q", got)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,6 @@ func CreateVPC(db *badger.DB, name string, cfg *configuration.Config) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := netns.Call(name, guardPublicBridge); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := netif.BridgeSetMaster("vp-"+vpcID+"-e", cfg.PublicBridge()); err != nil {
|
if err := netif.BridgeSetMaster("vp-"+vpcID+"-e", cfg.PublicBridge()); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
package vpc
|
|
||||||
|
|
||||||
import (
|
|
||||||
"git.g3e.fr/syonad/two/internal/nft"
|
|
||||||
"git.g3e.fr/syonad/two/internal/sysctl"
|
|
||||||
)
|
|
||||||
|
|
||||||
const netnsPublicBridge = "br-public"
|
|
||||||
|
|
||||||
var bridgeNetfilterKeys = []string{
|
|
||||||
"net.bridge.bridge-nf-call-iptables",
|
|
||||||
"net.bridge.bridge-nf-call-ip6tables",
|
|
||||||
"net.bridge.bridge-nf-call-arptables",
|
|
||||||
}
|
|
||||||
|
|
||||||
func guardPublicBridge() error {
|
|
||||||
for _, key := range bridgeNetfilterKeys {
|
|
||||||
if _, err := sysctl.SetIfPresent(key, "0"); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if err := sysctl.Set("net.ipv4.conf."+netnsPublicBridge+".arp_ignore", "1"); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nft.SetBridgeGuard(netnsPublicBridge)
|
|
||||||
}
|
|
||||||
|
|
@ -132,14 +132,6 @@
|
||||||
`delete vxlan: Link not found` et le watchdog a signalé `br-000000` et des VRF absents. L'agent
|
`delete vxlan: Link not found` et le watchdog a signalé `br-000000` et des VRF absents. L'agent
|
||||||
revient désormais au netns du thread courant, et un thread qui ne peut pas y revenir est
|
revient désormais au netns du thread courant, et un thread qui ne peut pas y revenir est
|
||||||
détruit au lieu d'être réutilisé. La création d'un netns est corrigée de la même façon
|
détruit au lieu d'être réutilisé. La création d'un netns est corrigée de la même façon
|
||||||
- **Rien n'entre plus dans un VPC par le `br-public` de son netns (#42).** Ce bridge, qui relie le
|
|
||||||
netns au segment public de l'hôte, répondait à l'ARP pour toutes les adresses du netns
|
|
||||||
(`arp_ignore=0`) et laissait entrer l'IP : un équipement du segment public pouvait router vers
|
|
||||||
les VM du VPC (mesuré en lab). L'agent pose désormais `arp_ignore=1` sur ce bridge et rejette en
|
|
||||||
nftables tout IP arrivé par lui
|
|
||||||
- **`br_netfilter` est désactivé dans le netns de chaque VPC (#42)** quand le module est chargé
|
|
||||||
(`bridge-nf-call-iptables`, `-ip6tables`, `-arptables` à 0) : conntrack voyait chaque trame
|
|
||||||
pontée, et le SNAT de la passerelle NAT ne s'appliquait pas (mesuré en lab)
|
|
||||||
- **Le serveur de métadonnées crée sa socket dans le netns du VPC (#92).** Il faisait entrer un
|
- **Le serveur de métadonnées crée sa socket dans le netns du VPC (#92).** Il faisait entrer un
|
||||||
seul thread dans le VPC, puis créait sa socket sur le thread où il s'exécutait à cet instant :
|
seul thread dans le VPC, puis créait sa socket sur le thread où il s'exécutait à cet instant :
|
||||||
sur un autre thread, la socket était créée dans le netns de l'hôte, l'écoute échouait et le
|
sur un autre thread, la socket était créée dans le netns de l'hôte, l'écoute échouait et le
|
||||||
|
|
@ -172,9 +164,6 @@
|
||||||
la fuite vers l'underlay décrite plus haut reste possible. Pour la fermer sans recréer le VPC,
|
la fuite vers l'underlay décrite plus haut reste possible. Pour la fermer sans recréer le VPC,
|
||||||
la poser à la main sur chaque hyperviseur, la table étant le `l3vni` du VPC :
|
la poser à la main sur chaque hyperviseur, la table étant le `l3vni` du VPC :
|
||||||
`ip route replace unreachable default metric 4278198272 table <l3vni>`
|
`ip route replace unreachable default metric 4278198272 table <l3vni>`
|
||||||
- **`br-public` du netns (#42) : seuls les VPC créés par la 0.3.0 sont protégés.** L'agent ne
|
|
||||||
reprend pas les VPC existants au démarrage : recréer chaque VPC pour fermer l'entrée par le
|
|
||||||
segment public
|
|
||||||
- **`name` est obligatoire sur chaque interface de `POST /vms` (#88)** : un appel qui l'omet reçoit
|
- **`name` est obligatoire sur chaque interface de `POST /vms` (#88)** : un appel qui l'omet reçoit
|
||||||
un 400. Au démarrage, l'agent nomme `nic-<rang>` (`nic-0`, `nic-1`…) les interfaces des VM
|
un 400. Au démarrage, l'agent nomme `nic-<rang>` (`nic-0`, `nic-1`…) les interfaces des VM
|
||||||
existantes
|
existantes
|
||||||
|
|
|
||||||
|
|
@ -116,17 +116,13 @@ on hv2 <<'NODE'
|
||||||
check "hv2 : bascule, passerelle ng-t46 recréée sur hv2, même IP" api_post nat-gateways '{"name":"ng-t46","vpc":"vp-t46","ip":"240.0.0.46/24","gateway":"240.0.0.1"}'
|
check "hv2 : bascule, passerelle ng-t46 recréée sur hv2, même IP" api_post nat-gateways '{"name":"ng-t46","vpc":"vp-t46","ip":"240.0.0.46/24","gateway":"240.0.0.1"}'
|
||||||
check "hv2 : ng-t46 running" wait_state nat-gateways/ng-t46 running
|
check "hv2 : ng-t46 running" wait_state nat-gateways/ng-t46 running
|
||||||
check "hv2 : même MAC 02:04:00:00:11:f8 qu'avant la bascule" sh -c "ip -n vp-t46 -o link show ng-t46 | grep -q 'link/ether 02:04:00:00:11:f8 '"
|
check "hv2 : même MAC 02:04:00:00:11:f8 qu'avant la bascule" sh -c "ip -n vp-t46 -o link show ng-t46 | grep -q 'link/ether 02:04:00:00:11:f8 '"
|
||||||
|
check "t46-b (hôte de la passerelle désormais) joint 240.255.0.1" vm_ssh vp-t46 10.46.2.10 'ping -n -c 3 -W 2 240.255.0.1'
|
||||||
NODE
|
NODE
|
||||||
|
|
||||||
on hv3 <<'NODE'
|
on hv3 <<'NODE'
|
||||||
check "hv3 : 02:04:00:00:11:f8 a suivi la passerelle, apprise via hv2" wait_evpn_mac 1 02:04:00:00:11:f8 192.168.14.12
|
check "hv3 : 02:04:00:00:11:f8 a suivi la passerelle, apprise via hv2" wait_evpn_mac 1 02:04:00:00:11:f8 192.168.14.12
|
||||||
NODE
|
NODE
|
||||||
|
|
||||||
on hv2 <<'NODE'
|
|
||||||
for i in $(seq 1 15); do vm_ssh vp-t46 10.46.2.10 'ping -n -c 1 -W 2 240.255.0.1' >/dev/null 2>&1 && break; sleep 2; done
|
|
||||||
check "t46-b (hôte de la passerelle désormais) joint 240.255.0.1" vm_ssh vp-t46 10.46.2.10 'ping -n -c 3 -W 2 240.255.0.1'
|
|
||||||
NODE
|
|
||||||
|
|
||||||
on hv1 <<'NODE'
|
on hv1 <<'NODE'
|
||||||
check "hv1 : vrf-t46 apprend la route par défaut via le VTEP de hv2" wait_vrf_route vp-t46 default 192.168.14.12
|
check "hv1 : vrf-t46 apprend la route par défaut via le VTEP de hv2" wait_vrf_route vp-t46 default 192.168.14.12
|
||||||
START=$(date +%s)
|
START=$(date +%s)
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ check "t47-a joignable sur hv2" vm_wait vp-t47 10.47.1.10
|
||||||
check "hv2 : fip-t47 recréée sur hv2, même IP" api_post floating-ips '{"name":"fip-t47","vm":"t47-a","interface":"nic-0","ip":"240.0.0.47/24","gateway":"240.0.0.1"}'
|
check "hv2 : fip-t47 recréée sur hv2, même IP" api_post floating-ips '{"name":"fip-t47","vm":"t47-a","interface":"nic-0","ip":"240.0.0.47/24","gateway":"240.0.0.1"}'
|
||||||
check "hv2 : fip-t47 running" wait_state floating-ips/fip-t47 running
|
check "hv2 : fip-t47 running" wait_state floating-ips/fip-t47 running
|
||||||
check "hv2 : même MAC 02:05:f0:00:00:2f qu'avant le déplacement" sh -c "ip -n vp-t47 -o link show fip-f000002f | grep -q 'link/ether 02:05:f0:00:00:2f '"
|
check "hv2 : même MAC 02:05:f0:00:00:2f qu'avant le déplacement" sh -c "ip -n vp-t47 -o link show fip-f000002f | grep -q 'link/ether 02:05:f0:00:00:2f '"
|
||||||
|
check "t47-a (hv2) sort par son IP flottante" vm_ssh vp-t47 10.47.1.10 'ping -n -c 3 -W 2 240.255.0.1'
|
||||||
NODE
|
NODE
|
||||||
|
|
||||||
on hv3 <<'NODE'
|
on hv3 <<'NODE'
|
||||||
|
|
@ -95,8 +96,3 @@ for i in $(seq 1 30); do ip netns exec t47-pub ping -n -c 1 -W 1 240.0.0.47 >/de
|
||||||
info "hv3 : 240.0.0.47 joignable $(( $(date +%s) - START )) s après l'apprentissage de la MAC via hv2"
|
info "hv3 : 240.0.0.47 joignable $(( $(date +%s) - START )) s après l'apprentissage de la MAC via hv2"
|
||||||
check "hv3 : t47-pub joint t47-a sur hv2 par son IP flottante" ip netns exec t47-pub ping -n -c 3 -W 2 240.0.0.47
|
check "hv3 : t47-pub joint t47-a sur hv2 par son IP flottante" ip netns exec t47-pub ping -n -c 3 -W 2 240.0.0.47
|
||||||
NODE
|
NODE
|
||||||
|
|
||||||
on hv2 <<'NODE'
|
|
||||||
for i in $(seq 1 15); do vm_ssh vp-t47 10.47.1.10 'ping -n -c 1 -W 2 240.255.0.1' >/dev/null 2>&1 && break; sleep 2; done
|
|
||||||
check "t47-a (hv2) sort par son IP flottante" vm_ssh vp-t47 10.47.1.10 'ping -n -c 3 -W 2 240.255.0.1'
|
|
||||||
NODE
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue