Metallb, BGP, Internal IPs, OpenWRT, External Connectivity, & Minikube

463 views
Skip to first unread message

Mateus Amin

unread,
Jul 22, 2021, 5:49:36 PM7/22/21
to metallb-users
This setup works end to end. Letting me expose a service running on my desktop behind a private ip to the internet. If you have an openWRT router and a linux desktop this should work for you.

Very open to improvements.

OpenWRT(firewall port forwarding) -> OpenWRT (Bird BGP) <-external-> Ubuntu (Bird BGP) <-external-> Ubuntu(Minikube(Metallb))
OpenWRT(ddns)
OpenWRT(static dhcp)

Desktop (Bird BGP): [running on desktop but probably need to run a k8s deamon]
```
protocol bgp {
    local 192.168.1.124 as 64501;
    neighbor range 192.168.49.0/24 as 64500;
     ipv4 {
        import all;
        export all;
     };
}

protocol bgp {
    local 192.168.1.124 as 64501;
    neighbor 192.168.1.1 as 64504;
     ipv4 {
        import all;
        export all;
     };
}


protocol kernel {
    ipv4 {
         export all; # Default is export none
    };
}

protocol device {}
```

Router (Bird BGP):
```
protocol bgp {
    local 192.168.1.1 as 64504;
    neighbor 192.168.1.124 as 64501;
    ipv4 {
        import all;
        export all;
     };
}

protocol kernel {
    ipv4 {
         import all;
         export all; # Default is export none
    };
}

protocol device {}
```

Desktop (metallb):
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    peers:
    - peer-address: 192.168.1.124
      peer-asn: 64501
      my-asn: 64500
    address-pools:
    - name: default
      protocol: bgp
      addresses:
      - 192.168.49.3-192.168.49.64
```

k8s script:
```sh
minikube start #In docker mode

kubectl get configmap kube-proxy -n kube-system -o yaml | \
sed -e "s/strictARP: false/strictARP: true/" | \
kubectl apply -f - -n kube-system

kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.10.2/manifests/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.10.2/manifests/metallb.yaml
#kubectl apply -f metallbconfigk8s.yaml
kubectl apply -f metallbbgpconfig.yaml

sleep 32
```

If you have any ideas on improving it please let me know.

Reply all
Reply to author
Forward
0 new messages