Configuring VLAN on Servers for Network Segmentation

The server fleet is growing, and traffic from different services begins to interfere with each other — risks and time spent on troubleshooting failures increase. We configure VLANs on servers on a turnkey basis: we design the segmentation scheme, migrate configurations without service downtime, and hand over access policies. The customer receives isolated segments, predictable permissions, and a clear network evolution plan.

Our competencies:

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1365
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1330
  • B2B Advance company logo design
    B2B Advance company logo design
    776
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1077
  • AIDER company logo development
    AIDER company logo development
    1022
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1113

VLAN Configuration in Linux: Where Segmentation Breaks

As long as all servers sit in one flat network, any failure in it becomes shared: there is a single broadcast domain, and a flood of service frames from one faulty machine reaches everyone.

Previously this was solved by physically separating switches; now the same result is achieved by VLAN configuration in Linux — segment boundaries are described by configuration rather than by purchasing hardware.

The cost of a flat network manifests not in peaceful days but during an incident.

An infected or simply misconfigured node sees its neighbors directly and can enumerate their services without a single barrier — there is no traffic isolation at either the addressing level or the access level.

The same node, once it starts sending broadcast requests, consumes bandwidth for the entire rack, and services unrelated to the failure degrade.

Server network segmentation divides the environment into managed broadcast domains: the database, application layer, service traffic, and administration live separately, and movement between them is possible only through explicitly described rules.

On the host, this is done by tagging frames on the interface and bridges for virtual machines — a single link to the switch carries several segments, and the kernel decides what belongs where.

This usually breaks at the junction: the tag is not removed where it should be, the management segment turns out to be accessible from the application segment, and some virtual machines remain without a tag and go into the default segment.

Such a mistake is not visible in tests — it is visible at the moment of failure. Below we examine exactly where segmentation is lost and how to close it with configuration.

What Traffic Segmentation Delivers: The Effect in Numbers

Traffic segmentation removes an entire class of failures. In a flat network, an emergency flow from one node spreads across all ports, and the failure of one workload drags down its neighbors — at the moment of failure, almost all services are affected.

After separation into VLANs, the blast radius is limited to the segment, and the other environments continue to operate.

Failure localization time is reduced by narrowing the search area, not by reaction speed. Diagnostics begin at the segment boundary: error and drop counters on the trunk port, the address table, routes between segments.

The question "where is the problem" turns into "in which segment," and troubleshooting fits into minutes instead of hours of continuous node-by-node inspection.

Environment isolation provides predictability. The test environment, load tests, and migrations no longer share bandwidth with production services — traffic from test benches does not leave its segment, and a spike on one of them does not affect the others.

Network fault tolerance relies on binding the segment to a link aggregation: if one physical link fails, traffic moves to the second without reconfiguring addressing.

Connections between segments are described by explicit rules — permitted paths exist, everything else is dropped and logged, so risk reduction here is measurable: it is clear who goes where.

In Linux, the scheme is assembled with standard kernel tools: a vlan-aware bridge and interface aggregation are described declaratively, the configuration is stored in a repository, and deployment is reproducible. A new environment is added as a separate segment, not as another node in a shared network.

VLAN Modes: Access Ports, Trunk, and Routing

The port mode on the switch determines whether a frame leaves with a tag or without one and how many segments it carries. Access ports deliver untagged traffic to strictly one segment — this is how servers and guest systems that know nothing about frame tagging are connected.

A trunk between switches and a hypervisor uplink carry tagged traffic for several segments at once over a single link.

Communication between segments will not appear by itself: it needs to be routed — on an L3 switch or a separate node, where communication rules are set explicitly.

Without this, the segments will remain isolated, and service communication — backups, updates, monitoring — will have to be assembled manually.

Organization Options

Option When It Fits Limitations
Access ports servers and systems within one segment one segment per port; moving to another segment means editing the port configuration
Tagged trunk backbone between switches, hypervisor uplink with systems in different segments the mode and tag list are agreed at both ends; the default untagged segment is a common source of leaks
Hybrid port one device sends part of the traffic with tags and part without non-obvious logic, failures take longer to diagnose
Routing between segments controlled communication between segments is needed an L3 switch or router is required, and communication rules must be maintained and verified

In practice, the mode is chosen for the task: access — for end systems, trunk — for backbones and virtualization, routing — where communication between segments is needed but must be limited by rules.

How Segmentation Implementation Proceeds: Work Stages

Segmentation implementation begins not with editing configurations but with inventorying what already works. First, it is necessary to understand which services exchange traffic constantly, which requests are rare, and which should not pass at all.

Without this picture, any subnetting breaks working connections, and rollback takes more time than the project itself.

The order of work is as follows:

  1. Network audit. We compile an inventory of switches, hypervisors, physical interfaces, and current subnets. Separately, we record a map of connections between services and external consumers — it will become the basis for the rules.
  2. Addressing scheme. We assign each segment its own subnet, interface names, and routing between them. Here we also decide which services remain in the shared segment and why.
  3. VLAN scheme design. We mark ports for tagged and untagged traffic and coordinate the marking with virtualization so the rules work the same on both physical and virtual nodes.
  4. Assembly on the test environment. We migrate one group of services, check routing and behavior when an individual segment fails.
  5. Isolation verification. We scan from each segment: prohibited connections do not pass, permitted ones respond. We record the result as a baseline before migrating production services.
  6. Phased migration. We move production services in groups, with maintenance windows and a rollback plan at each step.
  7. Handover to operations. We provide the addressing scheme, configurations, a procedure for connecting new nodes, and recovery instructions — so that your team makes further changes.

The final step is a control run of isolation checks on the production environment a few days after migration: it shows whether any bypass connections have appeared, which usually surface during actual operation.

Addressing Schemes, Configurations, and Access Policies

VLAN segmentation lives longer than the engineer who configured it.

That is why we record the result of the work in artifacts that allow the network to be developed and restored without the author: a new administrator understands the topology in a day, not in a week of reading production configurations.

  • Switch configurations — exports of the actual settings in full, not just changed lines: ports, tags, trunk and access interfaces.
  • Network map — a diagram in an editable source: which segments exist, what belongs to them, and where routes converge.
  • Access matrix — a "segment → resource → allowed or closed" table that shows the purpose of each rule.
  • Addressing scheme — subnet plans, gateways, ranges, and blocks reserved for growth.
  • Change procedure — who approves the edit, where the reference configuration is stored, and how rollback to the previous state is performed.
  • Network documentation — a description of the logic: why segment boundaries are drawn exactly this way and which rules are intentionally kept narrow.
  • Verification procedure — a checklist of actions after an edit and the rollback point to which you can return.

Configurations are stored with edit history, so any change can be compared with the previous one and reverted. Once a quarter, we reconcile the map and access matrix with the actual state of the switches: discrepancies are eliminated before they become a cause of failure.

Case Study: Segmenting a Server Fleet Without Service Downtime

Before: One Flat Network for the Entire Fleet

A customer came to us with a fleet of about 120 servers across three sites, combined into one flat network.

Every node could see all the others: a test bench could take the address of a production service, and a faulty network card on one server generated a broadcast storm across the entire fleet.

Finding the source of the problem took hours because traffic was not limited in any way, and a suspicious node could only be disconnected blindly.

What We Changed

We split the fleet into segments by purpose: management, production environment, database, test benches, and development environment. Between segments, we left only explicitly permitted flows; everything else is cut off at the gateway.

We keep the port and tag configuration in a repository and apply it via Ansible — a change passes validation before rollout instead of being made manually on the switch.

After: Metrics

Broadcast traffic in the production environment decreased by a factor of approximately six — network cards and switches no longer spread someone else's noise.

Finding the source of a problem now takes tens of minutes instead of hours: it is clear which segment the anomaly is coming from. The number of address conflicts dropped to zero because the ranges no longer overlap between test benches and production.

The migration was carried out without service downtime: groups of servers were moved one at a time, and each switchover had a fast rollback to the previous scheme.

A new segment is brought up by an edit in the repository and takes minutes, rather than coordinating changes on live equipment.

How Does Tagging Differ from Physical Network Separation?

Physical network separation means a separate switch port, cable, and network adapter for each segment.

A failure of one environment does not affect the others, behavior is predictable and does not depend on the configuration of neighbors, but each new segment requires hardware and installation — the cost of network ownership grows linearly with their number.

Traffic tagging moves segment isolation inside the frame: the switch and kernel mark the packet with a VLAN identifier, and the receiving side places it into a separate virtual interface.

A single physical channel carries traffic for dozens of networks, and a new segment is created by editing configuration rather than laying cable.

The flexibility of the scheme is the main difference. With physical separation, moving a segment between racks means recabling, while with tagging it means changing the tag on the port and updating the interface profile.

The flip side: segments share common transport, so an error on a trunk port exposes all networks at once, and troubleshooting requires reading switching tables rather than testing cable continuity.

Therefore, in practice, both approaches are combined.

Environments with different trust levels, such as management and public services, are physically separated, while within an environment, VLAN configuration in Linux is used: virtual interfaces on top of a common channel, separate routing tables, and filtering rules between them.

The hybrid provides a predictable failure boundary and flexibility within the perimeter — the choice between schemes should be based on the number of segments and the required frequency of changes, not on habit.

Concerns About Compatibility, Loops, and Change Rollback

Compatibility rarely becomes a stop factor: almost any managed switch of a current generation supports frame tagging, and the bottleneck is usually unmanaged models at the periphery.

They do not necessarily need to be replaced — such an area remains within a single segment, and access separation is done on the host side using operating system tools.

Before work, we reconcile the port matrix and trunk link modes with the current scheme so as not to convert to tagging something that is physically not ready for it.

We make network changes in stages, preserving a backup path: until the new segment is verified, traffic continues along the previous route, and the switchover occurs after control checks.

Configurations are captured before editing and stored separately, so returning to the original state is applying a pre-prepared set, not restoring from memory.

What happens if some equipment does not support tagging?

We do not forcibly move such an area into a shared trunk. It either remains in a separate segment with its own addressing, or the separation is moved to the host level and to filtering rules.

In the report, you receive a map: what is already ready for segmentation and what will become the next step during a planned replacement.

How do you protect against network loops?

A loop occurs where a second path appears between switches without an agreed spanning tree. Therefore, we first capture the topology, explicitly designate the root switch, and verify that backup links transition to blocking rather than active forwarding. On managed ports, we additionally enable protection against reconnection of the same segment.

Can the previous scheme be restored if something goes wrong?

Yes, rollback is planned before work begins. We capture configurations, record the order of reverse actions, and keep the previous traffic path working until the result is confirmed.

If checks on the new segment do not pass, the return takes minutes and does not require redesigning the network.

Let's Discuss Your Segmentation Scheme — We'll Come Back with a Plan

There is no universal segmentation scheme: it depends on which interfaces are already in use, where routing between segments takes place, and how addressing is structured.

To make the estimate accurate rather than an approximate range, we review your current configuration before starting VLAN configuration on Linux servers. Describe the task in words — attach to the description what already exists in the infrastructure.

  • general network diagram: switches, hypervisors, physical servers, and routing points between segments;
  • export of interface configurations and routing tables — as text or an export from the management system;
  • current VLAN division: numbers, purpose, subnets, and gateways on each;
  • addressing and name resolution scheme: who issues addresses, where records are maintained;
  • isolation requirements: which services must see each other and which should not in principle;
  • maintenance windows and the change approval procedure, availability of backup channels;
  • constraints: equipment that cannot be reconfigured, external contractors, audit requirements.

In response, you receive an implementation plan with stages, switchover order, and rollback points at each step, as well as work timelines tied to your maintenance windows.

Describe the task in free form — we will come back with an estimate and a plan.