SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
Building your own CGN
with Linux
Maximilian Wilhelm
DENOG12
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Agenda
●
Background
●
Why?
●
How?
●
The struggles
●
The solution
●
Questions
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Background
●
Mid-size German university
– 20k students
– 2.5k employees
– Some guests
– Main campus
+ 3.5 remote sites
– Part of eduroam
© University Paderborn, Johannes Pauly
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
The WIFI challenge
●
10k users (peak, pre-covid)
●
7 IPv4 (public) prefixes
●
VLAN mapping magic in radius
– Based on first character of username
– Has to be updated each semester
●
We‘re out of prefixes to add
●
4Gb/s WIFI traffic
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
The Plan
●
Add IPv6
●
Use one large private IPv4 prefix
●
Get rid of VLAN-mapping magic
●
NAT external IPv4 traffic
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Constraints
●
Two groups of users
– Internal (student, employee, local guest)
– External (roamed user from remote org)
●
Distinction required for some services
– Intranet
– Licensed stuff (library, etc.)
– Has to be represented in IP prefixes
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Network topology
●
Classic campus design
– Border
– Layer 3 core
– Distribution
– Access
– WIFI with CAPWAP to
DC
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Plan A – use existing boxes
●
Simple, border routers should NAT
– It‘s shiny ASR 9ks, they can do it!
●
Turns out, they can‘t
– ASR 9k need Virtualized Services Module for NAT
✗ Doesn‘t fit into our ASR 9001
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Plan B – buy
●
2x ASR 1001-HX
– 2RU
– IOS-XE
– 4x 10G
– 4 million NAT sessions
– 2x 750W PSU
●
~150 k€
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Plan C – build
●
Get two commodity servers
●
Shove decent NICs into it
●
Install (Debian) Linux
●
Configure bird
●
Configure nftables
●
Profit
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Sizing – CPU
●
One or two CPUs?
– Avoid NUMA*
●
How many cores?
– Distribute packet processing load, utilise NIC queues
– 1 Core routes 3Gb/s
●
Intel oder AMD?
– It‘s gonna be EPYC
➔
Single socket EPYC system
* https://www.youtube.com/watch?v=8NSzkYSX5nY
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Sizing – RAM
●
Last peak: 10k users
– Assume 200 sessions per users
➔ Design for 5m sessions
●
One session roughly consists of two 5-tuple + x
– 5-tuple <= 16B
– Let‘s asume 48B / session
●
5m * 48B / 10^20 = 228MB
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Sizing – Network
●
NIC should have
– Large Buffers
– Decent number of queues
– 2x 10/25G ports
●
Not Broadcom & Intel
➔
Mellanox ConnectX 4
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Hardware configuration
●
2x Dell R6515
– 1RU
– 1x EPYC 7542, 32C
– 4x 10/25G Mellanox ConnectX 4
– 32GB RAM
●
>1 billion sessions*
– 2x 550W PSU
●
~10 k€
*calculated
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
How to integrate CGN into network?
●
Active-Active setup would be nice
– BGP + Anycast
– Requires ECMP
●
Policy
– Internal traffic should be routed regulary
– Traffic to external destinations should be NATed
➔ Will need policy-based routing (PBR)
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Option 1 – DC
●
Nexus 7010
– NX-OS
– PBR via route-map
●
PBR on SVIs to WIFI clients
– set next-hop to CGN-IP
✗
Only useful for DC networks
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Option B – Border
●
ASR 9001
– 4x SFP+ 8x XFP
– IOS-XR
– Supports PBR via VRF
✗
Router ports expensive
✗
Config complicated
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Option C – Core
●
Catalyst 9500-48Y4C
– IOS-XE
– PBR via route-map
●
PBR on interfaces do DC
– Easily extendible
✔
Ports available, cheap(er)
and 25G possible
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Core it is
●
Straight forward setup
– eBGP Core ↔ CGN nodes
– Anycast for CGN-srv-IP
– Route-map with
●
ACL to catch traffic
●
set next-hop recursive
✗
So you would think...
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
PBR on IOS-XE on Catalyst 9500
●
IOS-XE 16.9.4
• Recommended release when I started
• Configurable in route-map
✗ Route-map not applied to interface
✗ Log entry that something isn‘t
supported
➔
Upgrade to IOS-XE 16.12.3e
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
PBR on IOS-XE on Catalyst 9500
●
IOS-XE 16.12.3e
• Configurable in route-map
• Applied to interface
• Seems to work (with one NH)
●
2nd box added, 1st box drained
✗ 1st drained box get‘s ALL traffic
●
TAC says
✗ „Not supported on Cat9500“
✗ „Not on the BU roadmap either“
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
The solution
●
Two sub-interfaces
– Internal / external
●
BGP in GRT
●
VRF cgn
– Static default route to
CGN-srv-IP in GRT
●
PBR
– set vrf cgn
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
The CGN box
●
Debian stable
●
bird for BGP
– Plus drain switch
●
nftables for NAT (three rules!)
●
conntrackd for stateful failover
●
Bloody details: BLOG
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
NAT – Nftables
# NATs are good
table ip nat {
chain postrouting {
type nat hook postrouting priority 100; policy accept;
ip saddr 100.64.0.0/12 snat to 192.0.2.0-192.0.2.15
persistent
ip saddr 100.127.0.0/16 snat to 203.0.113.240-
203.0.113.247 persistent
}
}
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Conntrackd
●
User-space daemon for conntrack table sync
●
Allows sync via unicast or multicast
●
Setup
– Unicast
– NOTRACK mode
– Internal/external cache disabled
– TCPWindowTracking Off
– ExpectationSync On
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Bird
root@cgn-o2c-01[~]# birdc show route
0.0.0.0/0 via 198.51.100.28 on twe1-2.3101 [cr_cua_01_e 2020-09-15] * (100) [AS65049i]
via 198.51.100.40 on twe2-1.3101 [cr_n2a_01_e 2020-09-15] (100) [AS65049i]
via 198.51.100.24 on twe1-1.3101 [cr_o2g_01_e 2020-09-15] (100) [AS65049i]
100.64.0.0/10 via 198.51.100.17 on twe1-2 [cr_cua_01_i 2020-09-15] * (100) [AS65049i]
via 198.51.100.33 on twe2-1 [cr_n2a_01_i 2020-09-15] (100) [AS65049i]
via 198.51.100.9 on twe1-1 [cr_o2g_01_i 2020-09-15] (100) [AS65049i]
# NAT Pools für interne User
192.0.2.0/28 unreachable [nat_pools 2020-09-15] * (200)
192.0.2.32/28 unreachable [nat_pools 2020-09-15] * (200)
# NAT Pools für externe User
203.0.113.240/29 unreachable [nat_pools 2020-09-15] * (200)
203.0.113.248/29 unreachable [nat_pools 2020-09-15] * (200)
# Host-IP
198.51.100.252/32 dev lo [nat_srv_ip 2020-09-15] * (240)
# Anycast CGN Service-IP
198.51.100.254/32 dev anycast_srv [nat_srv_ip 2020-09-15] * (240)
Maximilian Wilhelm
Zentrum für Informations- und Medientechnologien
Thank you
●
Questions?

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Cilium + Istio with Gloo Mesh
Cilium + Istio with Gloo MeshCilium + Istio with Gloo Mesh
Cilium + Istio with Gloo Mesh
 
Intro to GitOps & Flux.pdf
Intro to GitOps & Flux.pdfIntro to GitOps & Flux.pdf
Intro to GitOps & Flux.pdf
 
Gitops: the kubernetes way
Gitops: the kubernetes wayGitops: the kubernetes way
Gitops: the kubernetes way
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDP
 
Building images efficiently and securely on Kubernetes with BuildKit
Building images efficiently and securely on Kubernetes with BuildKitBuilding images efficiently and securely on Kubernetes with BuildKit
Building images efficiently and securely on Kubernetes with BuildKit
 
Open shift 4 infra deep dive
Open shift 4    infra deep diveOpen shift 4    infra deep dive
Open shift 4 infra deep dive
 
Cilium - overview and recent updates
Cilium - overview and recent updatesCilium - overview and recent updates
Cilium - overview and recent updates
 
Room 2 - 4 - Juncheng Anthony Lin - Redhat - A Practical Approach to Traditio...
Room 2 - 4 - Juncheng Anthony Lin - Redhat - A Practical Approach to Traditio...Room 2 - 4 - Juncheng Anthony Lin - Redhat - A Practical Approach to Traditio...
Room 2 - 4 - Juncheng Anthony Lin - Redhat - A Practical Approach to Traditio...
 
Meetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOpsMeetup 23 - 03 - Application Delivery on K8S with GitOps
Meetup 23 - 03 - Application Delivery on K8S with GitOps
 
Rootless Containers
Rootless ContainersRootless Containers
Rootless Containers
 
Secure Infrastructure Provisioning with Terraform Cloud, Vault + GitLab CI
Secure Infrastructure Provisioning with Terraform Cloud, Vault + GitLab CISecure Infrastructure Provisioning with Terraform Cloud, Vault + GitLab CI
Secure Infrastructure Provisioning with Terraform Cloud, Vault + GitLab CI
 
Helm - Application deployment management for Kubernetes
Helm - Application deployment management for KubernetesHelm - Application deployment management for Kubernetes
Helm - Application deployment management for Kubernetes
 
Introduction to Kubernetes and Google Container Engine (GKE)
Introduction to Kubernetes and Google Container Engine (GKE)Introduction to Kubernetes and Google Container Engine (GKE)
Introduction to Kubernetes and Google Container Engine (GKE)
 
Gitops Hands On
Gitops Hands OnGitops Hands On
Gitops Hands On
 
Enhancing Network and Runtime Security with Cilium and Tetragon by Raymond De...
Enhancing Network and Runtime Security with Cilium and Tetragon by Raymond De...Enhancing Network and Runtime Security with Cilium and Tetragon by Raymond De...
Enhancing Network and Runtime Security with Cilium and Tetragon by Raymond De...
 
Gitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCDGitlab, GitOps & ArgoCD
Gitlab, GitOps & ArgoCD
 
GitOps w/argocd
GitOps w/argocdGitOps w/argocd
GitOps w/argocd
 
Kubernetes Networking 101
Kubernetes Networking 101Kubernetes Networking 101
Kubernetes Networking 101
 
Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)Introduction to the Container Network Interface (CNI)
Introduction to the Container Network Interface (CNI)
 
Application Centric Infrastructure (ACI), the policy driven data centre
Application Centric Infrastructure (ACI), the policy driven data centreApplication Centric Infrastructure (ACI), the policy driven data centre
Application Centric Infrastructure (ACI), the policy driven data centre
 

Semelhante a Building your own CGN boxes with Linux

Building your own sdn with debian linux salt stack and python
Building your own sdn with debian linux salt stack and pythonBuilding your own sdn with debian linux salt stack and python
Building your own sdn with debian linux salt stack and python
Maximilan Wilhelm
 

Semelhante a Building your own CGN boxes with Linux (20)

100Gbps OpenStack For Providing High-Performance NFV
100Gbps OpenStack For Providing High-Performance NFV100Gbps OpenStack For Providing High-Performance NFV
100Gbps OpenStack For Providing High-Performance NFV
 
Ocpeu14
Ocpeu14Ocpeu14
Ocpeu14
 
PLNOG16: Obsługa 100M pps na platformie PC , Przemysław Frasunek, Paweł Mała...
PLNOG16: Obsługa 100M pps na platformie PC, Przemysław Frasunek, Paweł Mała...PLNOG16: Obsługa 100M pps na platformie PC, Przemysław Frasunek, Paweł Mała...
PLNOG16: Obsługa 100M pps na platformie PC , Przemysław Frasunek, Paweł Mała...
 
FPGA on the Cloud
FPGA on the Cloud FPGA on the Cloud
FPGA on the Cloud
 
100 M pps on PC.
100 M pps on PC.100 M pps on PC.
100 M pps on PC.
 
Smartcom's control plane software, a customized version of FreeBSD by Boris A...
Smartcom's control plane software, a customized version of FreeBSD by Boris A...Smartcom's control plane software, a customized version of FreeBSD by Boris A...
Smartcom's control plane software, a customized version of FreeBSD by Boris A...
 
PCCC23:筑波大学計算科学研究センター テーマ1「スーパーコンピュータCygnus / Pegasus」
PCCC23:筑波大学計算科学研究センター テーマ1「スーパーコンピュータCygnus / Pegasus」PCCC23:筑波大学計算科学研究センター テーマ1「スーパーコンピュータCygnus / Pegasus」
PCCC23:筑波大学計算科学研究センター テーマ1「スーパーコンピュータCygnus / Pegasus」
 
Building your own sdn with debian linux salt stack and python
Building your own sdn with debian linux salt stack and pythonBuilding your own sdn with debian linux salt stack and python
Building your own sdn with debian linux salt stack and python
 
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RCThe Next Generation Firewall for Red Hat Enterprise Linux 7 RC
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
 
Unrevealed Story Behind Viettel Network Cloud Hotpot | Đặng Văn Đại, Hà Mạnh ...
Unrevealed Story Behind Viettel Network Cloud Hotpot | Đặng Văn Đại, Hà Mạnh ...Unrevealed Story Behind Viettel Network Cloud Hotpot | Đặng Văn Đại, Hà Mạnh ...
Unrevealed Story Behind Viettel Network Cloud Hotpot | Đặng Văn Đại, Hà Mạnh ...
 
CAPI and OpenCAPI Hardware acceleration enablement
CAPI and OpenCAPI Hardware acceleration enablementCAPI and OpenCAPI Hardware acceleration enablement
CAPI and OpenCAPI Hardware acceleration enablement
 
VMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep DiveVMworld 2016: vSphere 6.x Host Resource Deep Dive
VMworld 2016: vSphere 6.x Host Resource Deep Dive
 
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
[OpenStack Day in Korea 2015] Track 1-6 - 갈라파고스의 이구아나, 인프라에 오픈소스를 올리다. 그래서 보이...
 
Ceph, Now and Later: Our Plan for Open Unified Cloud Storage
Ceph, Now and Later: Our Plan for Open Unified Cloud StorageCeph, Now and Later: Our Plan for Open Unified Cloud Storage
Ceph, Now and Later: Our Plan for Open Unified Cloud Storage
 
RISC-V and OpenPOWER open-ISA and open-HW - a swiss army knife for HPC
RISC-V  and OpenPOWER open-ISA and open-HW - a swiss army knife for HPCRISC-V  and OpenPOWER open-ISA and open-HW - a swiss army knife for HPC
RISC-V and OpenPOWER open-ISA and open-HW - a swiss army knife for HPC
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVM
 
Exploring the Performance Impact of Virtualization on an HPC Cloud
Exploring the Performance Impact of Virtualization on an HPC CloudExploring the Performance Impact of Virtualization on an HPC Cloud
Exploring the Performance Impact of Virtualization on an HPC Cloud
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVM
 
FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)FD.io Vector Packet Processing (VPP)
FD.io Vector Packet Processing (VPP)
 
FD.IO Vector Packet Processing
FD.IO Vector Packet ProcessingFD.IO Vector Packet Processing
FD.IO Vector Packet Processing
 

Mais de Maximilan Wilhelm

This is the way - Holistic (Network) Automation
This is the way - Holistic (Network) AutomationThis is the way - Holistic (Network) Automation
This is the way - Holistic (Network) Automation
Maximilan Wilhelm
 
Intent driven, fully automated deployment of anycasted load balancers with ha...
Intent driven, fully automated deployment of anycasted load balancers with ha...Intent driven, fully automated deployment of anycasted load balancers with ha...
Intent driven, fully automated deployment of anycasted load balancers with ha...
Maximilan Wilhelm
 
Software Defined Freifunk Backbones
Software Defined Freifunk BackbonesSoftware Defined Freifunk Backbones
Software Defined Freifunk Backbones
Maximilan Wilhelm
 

Mais de Maximilan Wilhelm (18)

This is the way - Holistic (Network) Automation
This is the way - Holistic (Network) AutomationThis is the way - Holistic (Network) Automation
This is the way - Holistic (Network) Automation
 
Fun with PRB, VRFs and NetNS on Linux - What is it, how does it work, what ca...
Fun with PRB, VRFs and NetNS on Linux - What is it, how does it work, what ca...Fun with PRB, VRFs and NetNS on Linux - What is it, how does it work, what ca...
Fun with PRB, VRFs and NetNS on Linux - What is it, how does it work, what ca...
 
Contemporary network configuration for linux - ifupdown-ng
Contemporary network configuration for linux - ifupdown-ngContemporary network configuration for linux - ifupdown-ng
Contemporary network configuration for linux - ifupdown-ng
 
Angewandte Netzwerkgrundlagen reloaded - von Layer 1 bis 3
Angewandte Netzwerkgrundlagen reloaded - von Layer 1 bis 3Angewandte Netzwerkgrundlagen reloaded - von Layer 1 bis 3
Angewandte Netzwerkgrundlagen reloaded - von Layer 1 bis 3
 
Intent driven, fully automated deployment of anycasted load balancers with ha...
Intent driven, fully automated deployment of anycasted load balancers with ha...Intent driven, fully automated deployment of anycasted load balancers with ha...
Intent driven, fully automated deployment of anycasted load balancers with ha...
 
Anycast all the things
Anycast all the thingsAnycast all the things
Anycast all the things
 
Out-of-Band-Management für APU-Boards
Out-of-Band-Management für APU-BoardsOut-of-Band-Management für APU-Boards
Out-of-Band-Management für APU-Boards
 
Wie baue ich ein Freifunkbackbone - Was wir in den letzten 5 Jahren gelernt h...
Wie baue ich ein Freifunkbackbone - Was wir in den letzten 5 Jahren gelernt h...Wie baue ich ein Freifunkbackbone - Was wir in den letzten 5 Jahren gelernt h...
Wie baue ich ein Freifunkbackbone - Was wir in den letzten 5 Jahren gelernt h...
 
Best Current Operational Practices - Dos, Don’ts and lessons learned
Best Current Operational Practices - Dos, Don’ts and lessons learnedBest Current Operational Practices - Dos, Don’ts and lessons learned
Best Current Operational Practices - Dos, Don’ts and lessons learned
 
L2/L3 für Fortgeschrittene - Helle und dunkle Magie im Linux-Netzwerkstack
L2/L3 für Fortgeschrittene - Helle und dunkle Magie im Linux-NetzwerkstackL2/L3 für Fortgeschrittene - Helle und dunkle Magie im Linux-Netzwerkstack
L2/L3 für Fortgeschrittene - Helle und dunkle Magie im Linux-Netzwerkstack
 
Overlays & IP-Fabrics - viele Wege führen nach Rom und warum Layer2 keine Lös...
Overlays & IP-Fabrics - viele Wege führen nach Rom und warum Layer2 keine Lös...Overlays & IP-Fabrics - viele Wege führen nach Rom und warum Layer2 keine Lös...
Overlays & IP-Fabrics - viele Wege führen nach Rom und warum Layer2 keine Lös...
 
Dynamische Routingprotokolle Aufzucht und Pflege - BGP
Dynamische Routingprotokolle Aufzucht und Pflege - BGPDynamische Routingprotokolle Aufzucht und Pflege - BGP
Dynamische Routingprotokolle Aufzucht und Pflege - BGP
 
Dynamische Routingprotokolle Aufzucht und Pflege - OSPF
Dynamische Routingprotokolle Aufzucht und Pflege - OSPFDynamische Routingprotokolle Aufzucht und Pflege - OSPF
Dynamische Routingprotokolle Aufzucht und Pflege - OSPF
 
IPv6 im Jahre 2018
IPv6 im Jahre 2018IPv6 im Jahre 2018
IPv6 im Jahre 2018
 
Netzwerkgrundlagen - Von Ethernet bis IP
Netzwerkgrundlagen - Von Ethernet bis IPNetzwerkgrundlagen - Von Ethernet bis IP
Netzwerkgrundlagen - Von Ethernet bis IP
 
Contemporary Linux Networking
Contemporary Linux NetworkingContemporary Linux Networking
Contemporary Linux Networking
 
AS201701 - Building an Internet backbone with pure 1he servers and Linux
AS201701 - Building an Internet backbone with pure 1he servers and LinuxAS201701 - Building an Internet backbone with pure 1he servers and Linux
AS201701 - Building an Internet backbone with pure 1he servers and Linux
 
Software Defined Freifunk Backbones
Software Defined Freifunk BackbonesSoftware Defined Freifunk Backbones
Software Defined Freifunk Backbones
 

Último

Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
sexy call girls service in goa
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
ellan12
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 

Último (20)

Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 

Building your own CGN boxes with Linux

  • 1. Building your own CGN with Linux Maximilian Wilhelm DENOG12
  • 2. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Agenda ● Background ● Why? ● How? ● The struggles ● The solution ● Questions
  • 3. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Background ● Mid-size German university – 20k students – 2.5k employees – Some guests – Main campus + 3.5 remote sites – Part of eduroam © University Paderborn, Johannes Pauly
  • 4. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien The WIFI challenge ● 10k users (peak, pre-covid) ● 7 IPv4 (public) prefixes ● VLAN mapping magic in radius – Based on first character of username – Has to be updated each semester ● We‘re out of prefixes to add ● 4Gb/s WIFI traffic
  • 5. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien The Plan ● Add IPv6 ● Use one large private IPv4 prefix ● Get rid of VLAN-mapping magic ● NAT external IPv4 traffic
  • 6. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Constraints ● Two groups of users – Internal (student, employee, local guest) – External (roamed user from remote org) ● Distinction required for some services – Intranet – Licensed stuff (library, etc.) – Has to be represented in IP prefixes
  • 7. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Network topology ● Classic campus design – Border – Layer 3 core – Distribution – Access – WIFI with CAPWAP to DC
  • 8. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Plan A – use existing boxes ● Simple, border routers should NAT – It‘s shiny ASR 9ks, they can do it! ● Turns out, they can‘t – ASR 9k need Virtualized Services Module for NAT ✗ Doesn‘t fit into our ASR 9001
  • 9. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Plan B – buy ● 2x ASR 1001-HX – 2RU – IOS-XE – 4x 10G – 4 million NAT sessions – 2x 750W PSU ● ~150 k€
  • 10. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Plan C – build ● Get two commodity servers ● Shove decent NICs into it ● Install (Debian) Linux ● Configure bird ● Configure nftables ● Profit
  • 11. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Sizing – CPU ● One or two CPUs? – Avoid NUMA* ● How many cores? – Distribute packet processing load, utilise NIC queues – 1 Core routes 3Gb/s ● Intel oder AMD? – It‘s gonna be EPYC ➔ Single socket EPYC system * https://www.youtube.com/watch?v=8NSzkYSX5nY
  • 12. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Sizing – RAM ● Last peak: 10k users – Assume 200 sessions per users ➔ Design for 5m sessions ● One session roughly consists of two 5-tuple + x – 5-tuple <= 16B – Let‘s asume 48B / session ● 5m * 48B / 10^20 = 228MB
  • 13. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Sizing – Network ● NIC should have – Large Buffers – Decent number of queues – 2x 10/25G ports ● Not Broadcom & Intel ➔ Mellanox ConnectX 4
  • 14. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Hardware configuration ● 2x Dell R6515 – 1RU – 1x EPYC 7542, 32C – 4x 10/25G Mellanox ConnectX 4 – 32GB RAM ● >1 billion sessions* – 2x 550W PSU ● ~10 k€ *calculated
  • 15. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien How to integrate CGN into network? ● Active-Active setup would be nice – BGP + Anycast – Requires ECMP ● Policy – Internal traffic should be routed regulary – Traffic to external destinations should be NATed ➔ Will need policy-based routing (PBR)
  • 16. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Option 1 – DC ● Nexus 7010 – NX-OS – PBR via route-map ● PBR on SVIs to WIFI clients – set next-hop to CGN-IP ✗ Only useful for DC networks
  • 17. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Option B – Border ● ASR 9001 – 4x SFP+ 8x XFP – IOS-XR – Supports PBR via VRF ✗ Router ports expensive ✗ Config complicated
  • 18. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Option C – Core ● Catalyst 9500-48Y4C – IOS-XE – PBR via route-map ● PBR on interfaces do DC – Easily extendible ✔ Ports available, cheap(er) and 25G possible
  • 19. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Core it is ● Straight forward setup – eBGP Core ↔ CGN nodes – Anycast for CGN-srv-IP – Route-map with ● ACL to catch traffic ● set next-hop recursive ✗ So you would think...
  • 20. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien PBR on IOS-XE on Catalyst 9500 ● IOS-XE 16.9.4 • Recommended release when I started • Configurable in route-map ✗ Route-map not applied to interface ✗ Log entry that something isn‘t supported ➔ Upgrade to IOS-XE 16.12.3e
  • 21. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien PBR on IOS-XE on Catalyst 9500 ● IOS-XE 16.12.3e • Configurable in route-map • Applied to interface • Seems to work (with one NH) ● 2nd box added, 1st box drained ✗ 1st drained box get‘s ALL traffic ● TAC says ✗ „Not supported on Cat9500“ ✗ „Not on the BU roadmap either“
  • 22. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien The solution ● Two sub-interfaces – Internal / external ● BGP in GRT ● VRF cgn – Static default route to CGN-srv-IP in GRT ● PBR – set vrf cgn
  • 23. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien The CGN box ● Debian stable ● bird for BGP – Plus drain switch ● nftables for NAT (three rules!) ● conntrackd for stateful failover ● Bloody details: BLOG
  • 24. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien NAT – Nftables # NATs are good table ip nat { chain postrouting { type nat hook postrouting priority 100; policy accept; ip saddr 100.64.0.0/12 snat to 192.0.2.0-192.0.2.15 persistent ip saddr 100.127.0.0/16 snat to 203.0.113.240- 203.0.113.247 persistent } }
  • 25. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Conntrackd ● User-space daemon for conntrack table sync ● Allows sync via unicast or multicast ● Setup – Unicast – NOTRACK mode – Internal/external cache disabled – TCPWindowTracking Off – ExpectationSync On
  • 26. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Bird root@cgn-o2c-01[~]# birdc show route 0.0.0.0/0 via 198.51.100.28 on twe1-2.3101 [cr_cua_01_e 2020-09-15] * (100) [AS65049i] via 198.51.100.40 on twe2-1.3101 [cr_n2a_01_e 2020-09-15] (100) [AS65049i] via 198.51.100.24 on twe1-1.3101 [cr_o2g_01_e 2020-09-15] (100) [AS65049i] 100.64.0.0/10 via 198.51.100.17 on twe1-2 [cr_cua_01_i 2020-09-15] * (100) [AS65049i] via 198.51.100.33 on twe2-1 [cr_n2a_01_i 2020-09-15] (100) [AS65049i] via 198.51.100.9 on twe1-1 [cr_o2g_01_i 2020-09-15] (100) [AS65049i] # NAT Pools für interne User 192.0.2.0/28 unreachable [nat_pools 2020-09-15] * (200) 192.0.2.32/28 unreachable [nat_pools 2020-09-15] * (200) # NAT Pools für externe User 203.0.113.240/29 unreachable [nat_pools 2020-09-15] * (200) 203.0.113.248/29 unreachable [nat_pools 2020-09-15] * (200) # Host-IP 198.51.100.252/32 dev lo [nat_srv_ip 2020-09-15] * (240) # Anycast CGN Service-IP 198.51.100.254/32 dev anycast_srv [nat_srv_ip 2020-09-15] * (240)
  • 27. Maximilian Wilhelm Zentrum für Informations- und Medientechnologien Thank you ● Questions?