Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

How to customize the Red Hat OpenShift 3.11 SDN

November 1, 2019
Mohammad Ahmad
Related topics:
Kubernetes
Related products:
Red Hat OpenShiftRed Hat OpenShift Container Platform

    In this article, I'll highlight a practical case for customizing the Red Hat OpenShift software-defined network (SDN). To achieve this, I will identify the OpenShift-Ansible inventory parameters that configure different aspects of the OpenShift SDN, specifically the cluster, portal, and docker networks.

    Why customize the SDN?

    An important question I am often asked is: Why do you need to customize the SDN? Isn’t it completely internal? Users generally assume there is no need to customize the SDN because OpenShift’s SDN has no impact on networks outside the OpenShift cluster; therefore, IP conflicts should not be a concern. However, this is not always the case.

    In large organizations, designated private networks (e.g., 10.0.0.0/8) are often used “publicly” within the internal confines of the organization's own network. With that in mind, the primary concern is that services external to the OpenShift cluster may be using IPs within the normally private ranges that conflict with those used by the cluster itself.

    These conflicts will cause issues when applications in the OpenShift cluster attempt to communicate to these conflicting external services, as the OpenShift SDN will attempt to route these requests within its own network, causing these services to be unreachable from within the cluster.

    Background

    Default values

    The default networks configured by OpenShift at installation time are:

    Component Ansible inventory parameters Notes
    The cluster network osm_cluster_network_cidr and osm_host_subnet_length which by default are 10.128.0.0/14 and 9 respectively.

     

     

    Each node gets a “/23” subnet from this range, allowing a total of 512 subnets dedicated for nodes, and a total of 510 IPs on each node for containers.
    Running “oc get pods --all-namespaces -o wide” will show which IPs have been allocated from this range, and should all be within this range.
    The services network openshift_portal_net By default this is 172.30.0.0/16. This means you have a total of 65534 addresses to assign to services.

     

    Running “oc get services --all-namespaces” should also show that all service IPs are within this range.

    The docker network openshift_docker_options="--bip 172.17.0.1/16 --fixed-cidr 172.17.0.0/17" These values are command line arguments to the docker daemon configured by the openshift_docker_options variable in openshift-ansible.

    Customizing these values

    Fine-tuning each of these values dictates how large your cluster can grow by way of defining how many nodes, pods, and services it can handle. With that in mind, for a development cluster, you may want to allow more services, as opposed to pods, to address specific needs required by developers. However, on a production system, you may prefer the ability to scale in the number of nodes to address a business and operational requirement.

    This article is based on the situation where you only have the subnet 192.168.0.0/16 for the entire cluster to use. With that in mind, I partition the subnet as follows:

    Subnet Use
    192.168.0.0/17 cluster network (192.168.0.0 – 192.168.127.254), which allows for a total of 127 “/24” subnets, equaling 127 nodes with 254 IPs available to containers on each node.
    192.168.128.0/18 portal/service network (192.168.128.0-192.168.191.254) with a total of 16382 IPs for services.
    192.168.192.0/24 docker network, giving me a total of 127 IPs if I use openshift_docker_options="--bip 192.168.192.1/24 --fixed-cidr 192.168.192.1/25". This is only important for building images that have external dependencies, and doesn’t need to be large.

    Reasons why you might need to customize the OpenShift SDN

    To reiterate, here are a few reasons why you might want to customize the default OpenShift network:

    • The default OpenShift and docker networks created at install time conflict with the organization’s services running in the routable network range.
    • Network limitations mean it is not possible to dedicate the recommended single “/14” network for the cluster and two “/16” networks for OpenShift services and docker.

    Resulting configurations

    As a result, the following configurations reflect the smaller networks we have defined.

    Inventory parameter value
    osm_cluster_network_cidr 192.168.0.0/17
    osm_host_subnet_length 8
    openshift_portal_net 192.168.128.0/18
    openshift_docker_options "--bip 192.168.192.1/18 --fixed-cidr 192.168.192.1/19"

    Conclusion

    In this article, I have highlighted the OpenShift 3.11 inventory variables that determine how OpenShift’s SDN is created when OpenShift is installed. I have also identified some of the reasons why you would consider future-proofing your cluster for potential growth and provided an example case for customizing your SDN to mitigate the risk of IP conflict for services in your routed network and your OpenShift’s SDN.

    Credits

    Special thanks to Thomas Stockwell for his peer review.

    References

    • Red Hat OpenShift's SDN architectural overview
    • Configuring Red Hat OpenShift's SDN
    • Configure docker's default bridge network
    • Red Hat's recommendation for modifying the docker network
    • IP calculator/IP subnetting (tool I used)
    • OpenShift configuration parameters: osm_cluster_network_cidr, openshift_portal_net, osm_host_subnet_length, openshift_docker_options
    Last updated: January 12, 2024

    Recent Posts

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    • Preventing GPU waste: A guide to JIT checkpointing with Kubeflow Trainer on OpenShift AI

    • How to manage TLS certificates used by OpenShift GitOps operator

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.