Skip to content

Nuface Blog

隨意隨手記 Casual Notes

Menu
  • Home
  • About
  • Services
  • Blog
  • Contact
  • Privacy Policy
  • Login
Menu

Docker 建立特定網段

Posted on 2025-10-302025-10-30 by Rico

建立Docker Network 時指定網段及Gateway 的指令。
建立一個自訂的 Docker 網路,指定 subnet 與 gateway,可以用 docker network create 搭配 –subnet 與 –gateway 參數。


範例如下:

docker network create \
--driver=bridge \
--subnet=172.24.0.0/16 \
--gateway=172.24.0.1 \
mail-network


說明:

–driver=bridge → 預設就是 bridge,可以省略,但建議寫明。
–subnet=172.24.0.0/16 → 指定網段。
–gateway=172.24.0.1 → 指定網路閘道。
mail-network → 網路名稱。

建立好之後可以確認:

docker network inspect mail-network


會看到類似:

"IPAM": {
    "Config": [
        {
            "Subnet": "172.24.0.0/16",
            "Gateway": "172.24.0.1"
        }
    ]
}

Recent Posts

  • Postfix + Let’s Encrypt + BIND9 + DANE Fully Automated TLSA Update Guide
  • Postfix + Let’s Encrypt + BIND9 + DANE TLSA 指紋自動更新完整教學
  • Deploying DANE in Postfix
  • 如何在 Postfix 中部署 DANE
  • DANE: DNSSEC-Based TLS Protection

Recent Comments

  1. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on High Availability Architecture, Failover, GeoDNS, Monitoring, and Email Abuse Automation (SOAR)
  2. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on MariaDB + PostfixAdmin: The Core of Virtual Domain & Mailbox Management
  3. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Daily Operations, Monitoring, and Performance Tuning for an Enterprise Mail System
  4. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Final Chapter: Complete Troubleshooting Guide & Frequently Asked Questions (FAQ)
  5. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Network Architecture, DNS Configuration, TLS Design, and Postfix/Dovecot SNI Explained

Archives

  • December 2025
  • November 2025
  • October 2025

Categories

  • AI
  • Apache
  • Cybersecurity
  • Database
  • DNS
  • Docker
  • Fail2Ban
  • FileSystem
  • Firewall
  • Linux
  • LLM
  • Mail
  • N8N
  • OpenLdap
  • OPNsense
  • PHP
  • QoS
  • Samba
  • Switch
  • Virtualization
  • VPN
  • WordPress
© 2025 Nuface Blog | Powered by Superbs Personal Blog theme