7
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PlantUMLでネットワーク構成図を作成してみる

Last updated at Posted at 2024-03-06

PlantUMLとは

PlantUMLはオープンソースのUMLダイアグラム作成用のテキストベースの言語である(Wikiより抜粋)。UML(特にシーケンス図)を作成するときに良く用いられているらしいですが、ネットワーク構成図も作成できるということで使ってみました。

まずはPlantUML使うための準備

PlantUMLを気軽に使うのは VSCodeが良いのでまずVSCodeは先に準備しておきましょう。
あと必要なもの。

1. VSCode
2. Microsoft Build of OpenJDK(OpenJDK 21)
3. VSCode拡張モジュール PlantUML

ネットワーク構成図を作成

少しだけ勉強して…

@startuml

nwdiag {
   
    network Internal {
        address = "192.168.0.0/24";
        web [address = "192.168.0.1"];
        nas [address = "192.168.0.2"];
    }
}
@enduml

どうかな??(Qiitaのmarkdownで描画)・・・できた!!簡単やw

このサイトが勉強になる
https://plantuml.com/ja-dark/nwdiag

ちょっと凝ってみる

アイコンとか色を使って少し本格的につくってみる。

@startuml
!include <office/concepts/globe_internet>
!include <office/concepts/firewall>
!include <office/concepts/firewall_orange>
!include <office/Servers/application_server>
!include <office/Servers/database_server>
!include <office/Servers/web_server>
!include <office/Servers/virtual_server>
!include <office/Servers/virtual_web_server>
!include <office/Servers/virtual_web_server_blue>
!include <office/Servers/file_server>
!include <office/Servers/cluster_server>
!include <office/Servers/reverse_proxy>
!include <office/devices/router>
!include <office/devices/switch>
!include <office/devices/video_gateway>


nwdiag {
   
    internet [shape = cloud, description = "<$globe_internet>\n internet"];
    internet -- firewall;
    firewall [description = "<$firewall_orange>\n firewall"];

    network Internal {
        color = "pink";
        address = "192.168.0.0/24";
        firewall;
        ONU [address = "192.168.0.1", description = "<$router>\n ONU"];
        リブーター [address = "192.168.0.2"];
        ER605 [address = "192.168.0.3", description = "<$switch>\n ER605"];
        AdGuard  [address = "192.168.0.7", description = "<$reverse_proxy>\n AdGuard"];
        Synology_DS918 [address = "192.168.0.99", description = "<$file_server>\n webSynology_DS91801"];
        Proxmox8_1 [address = "192.168.0.10", description = "<$cluster_server>\n Proxmox8_1"];
        Proxmox8_2 [address = "192.168.0.20", description = "<$cluster_server>\n Proxmox8_2"];
    }

    network Proxmox8_1 {
        Proxmox8_1;
        host [address = "192.168.0.11", description = "<$virtual_server>\n host"];
        nginx [address = "192.168.0.13", description = "<$virtual_web_server>\n nginx"];
        apache [address = "192.168.0.12", description = "<$virtual_web_server_blue>\n apache"];
    }

    group {
        color = "#7777FF";

        Proxmox8_1;
        host;
        nginx;
        apache;
    }

    network Proxmox8_2 {
        Proxmox8_2;
        rokuge [address = "192.168.0.21", description = "<$video_gateway>\n rokuge"];
    }

    group {
        color = "#FFAAAA";

        Proxmox8_2;
        rokuge;
    }

    network VLAN1 {
        color = "green";
        address = "192.200.0.0/24";

        ER605  [address = "192.168.200.1"];
        web1 [address = "192.168.200.10", description = "<$web_server>\n web1"];
    }

    network VLAN2 {
        color = "green";
        address = "192.168.1.0/24";
        
        ER605  [address = "192.168.1.1"];
        web2 [address = "192.168.1.10", description = "<$web_server>\n web2"];
    }
}
@enduml

どうかな??(Qiitaのmarkdownで描画)・・・正味1時間ぐらいで作成できた。すごいな。

感想

いまさらながらのUMLですが、昔はVISIOつかったりExcel使ったりして苦労した覚えがあります。自分、センスがないからそういう面でも苦労しました。PlantUMLで割と気軽に作れるのがわかり今後の設計資料に使えるなと思いましたw。

アイコンも割と豊富にあり綺麗に作れる。いいですね。

参考にさせて頂いたサイト様

7
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?