慣性聚合 高效追讀感興趣之博客、新聞、科技資訊
閱原文 以慣性聚合開啟

推薦訂閱源

博客园 - 司徒正美
V
V2EX
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
月光博客
月光博客
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python)
小网为何 VLAN 划分被过度渲染?
Mustafa ERBA · 2026-05-24 · via DEV Community

每新业之系统或网络工,常以分片旧网为始,托名"固守"之。吾历廿载场务,睹同侪于五十人司中,竟立十五异VLAN,终为自设之规所压。小网VLAN分片何故过誉?,存乎灰色之域,其间理论之安全典籍与实务之运作实情相悖。

吾屡犯此失,既于己方产品之基构,复于所咨询之中型制造之设,皆须更正。今文,吾将以具体之度数与配置之例,释小网中VLAN分段,常为营运之障,而非救星。


小网中VLAN分段之观:理与实之辩

理论上,一切似无不美:会计部(VLAN 10)不应见人事部(VLAN 20),访客(VLAN 30)唯可上网,打印机(VLAN 40)当自绝。课堂讲习或厂商售书,此架构皆称“至善”。然世事非然;会计部阿美欲取人事部艾莉夫电脑之共享夹,或欲印而不得,汝之机必先鸣。

于小之络(如百器之数未达百者),每 VLAN 乃一 IP 之域,一网关,一 DHCP 之池,尤重者,则路由与防火之规也。百器之构分而为五 VLAN,实乃立五小络,而需治之也。

Traditional Approach (Over-Segmentation):
[Users]        --(VLAN 10)--\
[Printers]     --(VLAN 20)---+--> [Firewall / L3 Switch] --> [Internet]
[Servers]      --(VLAN 30)--/

Pragmatic Approach (Flat Network + Host-based Security):
[All Devices (Single Subnet /24)] ------> [Firewall] ------> [Internet]
  |_ (Software rules and endpoint security active)

Enter fullscreen mode Exit fullscreen mode

曩者,余承一廛主之务,其司仅四十人。厅中定八VLAN,部门各居其域,若孤岛然。绘事者欲取NAS之器,包必出边缘之枢,经核心之枢,越火墙之阻,循规而行,复由故道返。由是冗务横生,百兆之速,堕至百五十兆,为火墙之IPS/IDS包处理之能所限。


管理之累与"自噬"之悖

网段分得太细,其安全之度不增;反是,管理之繁易致谬误之机倍增。吾谓之"自噬"或曰操弄之盲。时日既久,规条积繁,遂授暂权Any to Any 防火墙之权限,以解燃眉之急,而临时之规遂成永制.

观此思科IOS之配置。此访问控制列表(ACL),本为连接二部门及一打印机而设,然网络日广,遂成梦魇.

! Complex ACL example written on a Cisco Switch
ip access-list extended DEPT_ACCOUNTING_ONLY
 permit tcp 192.168.10.0 0.0.0.255 192.168.40.10 0.0.0.0 eq 9100
 permit ip 192.168.10.0 0.0.0.255 192.168.10.0 0.0.0.255
 deny ip 192.168.10.0 0.0.0.255 192.168.20.0 0.0.0.255
 deny ip 192.168.10.0 0.0.0.255 192.168.30.0 0.0.0.255
 permit ip any any
! You have to update these rules every time a new device is added.

入全屏模式 出全屏模式

时日既久,管理此等规约愈觉艰险,网管于排障之际,终至放弃。如吾前文论及[相关:防火墙与网关管理]所言,凡手调非自动之规约,终必生安全之隙。小网之中,若行VLAN分割,每添新印或易用户案,必更配交换端口为干道/接入之状。

⚠️ 运营之险

若汝之网络无动态VLAN分配之制(如802.1X、RADIUS等),则基于端口之VLAN管理,使汝沦为物理交换机之奴。一缆误插,可阻全务之流.


IP规划与路由僵局:三层交换机抑或防火墙?

小网中实施VLAN分割,其最要紧之架构抉择,在于何处行跨VLAN路由。君有两途:一者于三层交换机终结并路由此道,二者将诸务悉推至边缘防火墙设备(Router-on-a-Stick)。

若将交通推于防火墙,则防火墙之端口容量与包处理之限,将成壅塞。譬如,汝或见复制文件于本地网络之备份服务器时,防火墙CPU达百分百。若于L3交换机行路由之事,汝将大失过滤VLAN间交通(施用安全规则)之能;L3交换机不能如防火墙行状态包检视,唯用简易ACL。

效能(吞吐量) 安全深度 管理便利
L3交换路由 甚高(线速) 低(仅无状态ACL)
防火墙路由 低/中(CPU受限) 甚高(状态检测/IPS)
平面网络(单子网) 至高 基于端点的安全 甚易

吾尝述一事于制器之ERP系统。厂中操作之屏与条码印机,别属一VLAN;而ERP之服务器,则在他处。每操作者按屏之钮,SQL之询即越防火墙而达于服务器。值生产极盛之时(尤以运货为甚),防火墙之会话表渐满,包损遂生。为解此困,吾等尽平网络之构,徙服务器与客户于同L2层。迟滞自12毫秒降为0.4毫秒。


DHCP、DNS及广播通信之迷:真实指标何言?

VLAN之倡者,常以减"广播域"之广为论。其言曰:"网中广播之流将甚,交换器或为之窒,ARP之包或泛溢于网。"此论于九十年代末,10 Base-T之集线器盛行时,尚有据。然当今之全双工千兆交换器,及操作系统之网络栈,二十五四之设备为广播域,亦寻常之务耳。

吾以实数析之。于平直之网,有活性器物百五十具(/24/23子网),吾以Wireshark一时辰之包析,得度数若左:

# Measuring broadcast packet ratio with Wireshark / tshark
$ tshark -r capture.pcap -q -z io,phs

===================================================================
Protocol Hierarchy Statistics
Filter: frames

eth                                      frames:1425300 bytes:1240500320
  ip                                     frames:1412000 bytes:1238400210
    udp                                  frames:85000   bytes:12400500
      dns                                frames:12000   bytes:1440000
  arp                                    frames:13300   bytes:851200   <-- Only 0.93%!
===================================================================

入全屏模式 出全屏模式

观之,ARP及其他广播报文于全流量之比,乃至不及百分之一。于一Gbps带宽之网,每秒数千字节之广播流量,于性能无碍。

复次,尔必配置各VLAN之别 DHCP助手(ip helper-address)或DHCP服务器。于Linux DHCP服务器中,为各子网定义别块(isc-dhcp-serverdnsmasq,處理IP衝突,並確保DNS整合非小團隊所必須之工作。


小規模網絡之替代與務實安全方法

既不使用VLAN分割,何以確保安全?答曰簡單:將安全自網絡層(L2/L3)移至應用與終端層。於現代世界,吾人稱此為零信任或主機基礎分割。

一公司之中,诸器俱在一IP之域,非谓可无限制互通。今之诸操作系统,皆内置可统御之防火墙(Windows Defender Firewall,Linux iptables/nftables,macOS PF)。

# On a Linux server (e.g., running PostgreSQL), allow only specific IPs
# Using host-based firewall instead of traditional VLAN:
sudo iptables -A INPUT -p tcp -s 192.168.1.50 --dport 5432 -j ACCEPT
sudo iptables -A INPUT -p tcp -s 192.168.1.0/24 --dport 5432 -j REJECT

入全屏模式 出全屏模式

此法可于服务器端独设存取控权,不须触开关之配置。复次,于Active Directory之境,以一击之机,可令Windows诸客端间之文件共享(SMB - 端口445)悉禁,此乃以集团政策(GPO)为之。如此,汝可防勒索软件之蔓延,非于网络之层,实直于操作系统之层也。

吾尝于《[相关:网络分割与零信任]》文中,论及此题之建筑细目与软件隔离之术。将此理施于小网,其效远胜于与硬件VLANs相争.


决策之表:当何时而真用VLANs?

固吾辈非尽废VLAN也。有境遇焉,用VLAN实为至要而合乎理。要者,非使其成执念,当因需而施之。

下有决断之表,可示君以网络中是否当行VLAN之区隔:

境遇 / 所需 VLAN是否必要? 实用之策
访客无线网络 须有别之VLAN,方能使访客之流完全隔绝,以防其侵公司之网
IP电话(VoIP) 是/尚可 设语音VLAN以优待QoS(服务质量),于VoIP之包尤宜
服务器室/隔离区 外显之服务(如网服务器等)须与局域网隔绝
部门分治 用Windows组策略、本地防火墙规则及活动目录授权
打印机与物联网设备 否(多) 固打印机IP,仅许经打印服务器访问。

若君之网络用户少于五十,且无关键服务器提供外部服务,则理想之网络设计为:一主子网(用户、打印机、本地服务器)+全然隔离之单客VLAN。此简易结构使汝之运营之负甚微,使汝得专力于应用层之安全,此乃汝真正当注力之处也。


吾之明见

小网之VLAN分割,往往不过技士欲"自娱其志",若"经略大业之网"。然实则,此过度巧思之力,反为尔致故障、迟滞、管理繁复,而非安危。

吾于此事之明见曰:汝所不欲之配置,皆为将来必须修正之虫源。毋以分网为务,当固守端点之防,立强认证之制,使网络基建至简、可察、趋平。至若夜寐安然,非赖繁复之换路规则,实因系统至简,可由汝掌之。