Open4

ネットワーク勉強の続き - 2

スパイン/リーフ型ネットワーク

参考:

https://access.redhat.com/documentation/ja-jp/red_hat_openstack_platform/13/html-single/spine_leaf_networking/index

https://qiita.com/FSCOMJapan/items/e7638e7014548725cb04

やること

これの簡単版を作る

参考: https://github.com/tinynetwork/tinet/tree/master/examples/basic_clos

簡単版:

  • めんどいのでスパイン/リーフは2つだけ
  • Top of Rack(TOR)も2つだけ
  • TORにぶら下がるサーバーは2台ずつ
  • OSPFとかBGPはまだわからないので普通にstatic routeで設定する

構成

量が多くてzennだと描画できないので↓のmarmaidをライブエディタ( https://mermaid.live/ ) で描画させてる

https://mermaid.live/edit#pako:eNqdV02P2kAM_StRTq200HnZ9CtSb-2tp_ZI0CpLBogKCQoBVCH-eyff4xlPYHsBZmw_-9nPAa7-qkilH_nrXXFZbZOy8n7-inPP2xbHKpfVpSj_eLPZzMvySpbq4tp_uMV57Xc8vW7K5LBtAiJPGebZ4Ryql5d1UV6SMv2G2o8gthdnWW3FIvab98gLxPNczIHnefAxjP3l6ITOCaNTqDnJPO1qOWS5FLMGryl6hBQfgvDdgp6X7xunxn0IBxMe3guH0Yu2kMlu6LUqevpRbwWGRnQeO5msWz-MYdpl5OFzMMcnFa-3UXMEFw0jGmx_CT_c5wfKDza_gFYIjh9YfhAMQ3AMwTMUmNDQmLGVwtDUVgnk2AnBnoWBBxsPFA8OPBh4cNVXN4UiCrtGsDXCWaMwqxRwYA51ErU02R5ZBo0Up22haRtu3QhON4LoZoxuPaqiHDVnXrWRQWhs1OAGOxJG5PQ2NZ17tD_g-gOTI98fcP2xYuu9ICxh9wdcf8yNHBxhx1od4rdx6OisLE7qe8eUfDOVUZzDsZOmOUoOEjYkKCRYSFBITFdJF1O70GDBVIo7lQqzVgEWlt_MOl-nEu2qZ6HmpZ1cAu2n7RyWvhjUom2WiQMnDiZw6G57DZnjJatWWxKAjhlnUlhf6z34Yqz7IEknajsYF24fTBrdOgpSjmKzeC2zdCO98y7JX9bZTqFk-cbD8j41YdvF7HhW1tfSZcNoa1hyz6haQk6lgCgFb1cKnEqBOeFJpcCpFAtHYFopcCsFplLwsFIwpRTcVQotB_-pFLiUggml4I5SLL1xRKkULRk6Q7q8NAjuPHDkgTsPjDzkGdnAmSPVedIN1gz64wTOXwB9DrA58IYcwVQOsDzg4gE2B6Z5gOUBFw_dQBZKz-E_-XtZ7pMsVX9Ur_W1gtjKvYz9SH1M5To57arYj_Obcj0d0qSSP9JMZfGjqjzJJz85VcXvv_nKj9bJ7ih7p-9Zogrfd7e3f9CgpWw
marmaid
flowchart LR
  hostnetwork --- internet{internet}

  subgraph host: net.ipv4.ip_forward=1
    hostnetwork
    veth0["veth0: 203.0.113.254"]
    veth1["veth1: 203.0.114.254"]
  end

  spine0-veth0 --- 203.0.113.0/24([203.0.113.0/24]) --- veth0
  spine1-veth0 --- 203.0.114.0/24([203.0.113.0/24]) --- veth1

  subgraph spine0: net.ipv4.ip_forward=1
    spine0-veth0["spine0-veth0: 203.0.113.1"]
    spine0-leaf0-veth1["spine0-leaf0-veth1: 172.16.0.254"]
    spine0-leaf1-veth1["spine0-leaf1-veth1: 172.16.1.254"]
  end

  subgraph spine1: net.ipv4.ip_forward=1
    spine1-veth0["spine1-veth0: 203.0.113.2"]
    spine1-leaf0-veth1["spine1-leaf0-veth1: 172.16.100.254"]
    spine1-leaf1-veth1["spine1-leaf1-veth1: 172.16.101.254"]
  end

  spine0-leaf0-veth0 --- 172.16.0.0/24([172.16.0.0/24]) --- spine0-leaf0-veth1
  spine0-leaf1-veth0 --- 172.16.1.0/24([172.16.1.0/24]) --- spine0-leaf1-veth1
  spine1-leaf0-veth0 --- 172.16.100.0/24([172.16.100.0/24]) --- spine1-leaf0-veth1
  spine1-leaf1-veth0 --- 172.16.101.0/24([172.16.101.0/24]) --- spine1-leaf1-veth1

  subgraph leaf0: net.ipv4.ip_forward=1
    spine0-leaf0-veth0["spine0-leaf0-veth0: 172.16.0.1"]
    spine1-leaf0-veth0["spine1-leaf0-veth0: 172.16.100.1"]
    leaf0-tor0-veth1["leaf0-tor0-veth1: 172.24.0.254"]
    leaf0-tor1-veth1["leaf0-tor1-veth1: 172.24.1.254"]
  end

  subgraph leaf1: net.ipv4.ip_forward=1
    spine0-leaf1-veth0["spine0-leaf1-veth0: 172.16.1.1"]
    spine1-leaf1-veth0["spine1-leaf1-veth0: 172.16.101.2"]
    leaf1-tor0-veth1["leaf1-tor0-veth1: 172.24.100.254"]
    leaf1-tor1-veth1["leaf1-tor1-veth1: 172.24.101.254"]
  end

  leaf0-tor-router0-veth0 --- 172.24.0.0/24([172.24.0.0/24]) --- leaf0-tor0-veth1
  leaf0-tor-router1-veth0 --- 172.24.1.0/24([172.24.1.0/24]) --- leaf0-tor1-veth1
  leaf1-tor-router0-veth0 --- 172.24.100.0/24([172.24.100.0/24]) --- leaf1-tor0-veth1
  leaf1-tor-router1-veth0 --- 172.24.101.0/24([172.24.101.0/24]) --- leaf1-tor1-veth1

  subgraph tor0
    subgraph tor-router0["tor-router0: net.ipv4.ip_forward=1"]
      leaf0-tor-router0-veth0["leaf0-tor-router0-veth0: 172.24.0.1"]
      leaf1-tor-router0-veth0["leaf1-tor-router0-veth0: 172.24.100.1"]
      tor-switch-router0-veth1["tor-switch-router0-veth1: 192.168.0.254"]
    end

    tor-switch-router0-veth0 --- tor-switch-router0-veth1

    subgraph tor-switch0["tor-switch0: [bridge vlan_filtering 1]"]
      tor-switch-router0-veth0
      tor-switch0-svr0-br0
      tor-switch0-svr1-br0
    end
  end

  subgraph tor1
    subgraph tor-router1["tor-router1: net.ipv4.ip_forward=1"]
      leaf0-tor-router1-veth0["leaf0-tor-router1-veth0: 172.24.1.1"]
      leaf1-tor-router1-veth0["leaf1-tor-router1-veth0: 172.24.101.1"]
      tor-switch-router1-veth1["tor-switch-router1-veth1: 192.168.1.254"]
    end

    tor-switch-router1-veth0 --- tor-switch-router1-veth1

    subgraph tor-switch1["tor-switch1: [bridge vlan_filtering 1]"]
      tor-switch-router1-veth0
      tor-switch1-svr0-br0
      tor-switch1-svr1-br0
    end
  end

  tor-switch0-svr0-veth0 --- tor-switch0-svr0-br0
  tor-switch0-svr1-veth0 --- tor-switch0-svr1-br0

  tor-switch1-svr0-veth0 --- tor-switch1-svr0-br0
  tor-switch1-svr1-veth0 --- tor-switch1-svr1-br0

  subgraph tor0-svr0
    tor-switch0-svr0-veth0["tor-switch0-svr0-veth0: 192.168.0.1"]
  end

  subgraph tor0-svr1
    tor-switch0-svr1-veth0["tor-switch0-svr0-veth0: 192.168.0.2"]
  end

  subgraph tor1-svr0
    tor-switch1-svr0-veth0["tor-switch1-svr0-veth0: 192.168.1.1"]
  end

  subgraph tor1-svr1
    tor-switch1-svr1-veth0["tor-switch1-svr1-veth0: 192.168.1.2"]
  end

ルートの冗長化はOSPFとか使わないと難しいのかも

https://www.pingcollege.com/routing-part8

TODO

作成者以外のコメントは許可されていません