0
0

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 3 years have passed since last update.

CentOS7のNW設定

Posted at

はじめに

CentOS7のネットワーク設定についてメモ

ネットワークの設定

NetworkManagerサービスによってネットワーク設定を管理

  • NICを表すデバイス
  • 接続(デバイスに適用する設定)

デバイスに接続(設定)を紐付ける

定義済みのデバイスの確認
CONNECTIONが接続


# nmcli d
DEVICE   TYPE      STATE     CONNECTION 
enp0s25  ethernet  接続済み  enp0s25    
lo       loopback  管理無し  -- 

定義済みの接続の確認

# nmcli c
NAME     UUID                                  TYPE      DEVICE  
enp0s25  173098fd-54de-48b1-95a1-ceaa687089ab  ethernet  enp0s25 

新たな接続の定義

  • 新しく接続したNICに対して新規の接続を紐付ける
  • nmcli -d でデバイスはあるが、接続がない状態

nmcliとnmtuiで接続を作成して、デバイスを紐付ける
nmtuiはGUIで設定できる

VLANデバイスの作成

VLAN77を作成

# nmcli c add type vlan ifname vlan77 con-name vlan-vlan77 dev enp0s25 id 77
接続 'vlan-vlan77' (1092e677-f16b-4a35-8839-19739d20a011) が正常に追加されました。
  1 VLAN=yes
  2 TYPE=Vlan
  3 PHYSDEV=enp0s25
  4 VLAN_ID=77
  5 REORDER_HDR=yes
  6 GVRP=no
  7 MVRP=no
  8 PROXY_METHOD=none
  9 BROWSER_ONLY=no
 10 BOOTPROTO=dhcp
 11 DEFROUTE=yes
 12 IPV4_FAILURE_FATAL=no
 13 IPV6INIT=yes
 14 IPV6_AUTOCONF=yes
 15 IPV6_DEFROUTE=yes
 16 IPV6_FAILURE_FATAL=no
 17 IPV6_ADDR_GEN_MODE=stable-privacy
 18 NAME=vlan-vlan77
 19 UUID=1092e677-f16b-4a35-8839-19739d20a011
 20 DEVICE=vlan77
 21 ONBOOT=yes

上にIPアドレスを設定する

vlanデバイスの稼働確認

 cat /proc/net/vlan/config 
VLAN Dev name    | VLAN ID
Name-Type: VLAN_NAME_TYPE_RAW_PLUS

詳細

# cat /proc/net/vlan/vlan77 
vlan77  VID: 77  REORDER_HDR: 1  dev->priv_flags: 1
         total frames received            0
          total bytes received            0
      Broadcast/Multicast Rcvd            0

      total frames transmitted           13
       total bytes transmitted         1022
Device: enp0s25
INGRESS priority mappings: 0:0  1:0  2:0  3:0  4:0  5:0  6:0 7:0
 EGRESS priority mappings: 
0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?