Configure a VLAN (on top of a bond) with NetworkManager (nmcli) in RHEL7

來源:互聯網
上載者:User

標籤:gateway   env   profile   dns   signed   slaves   https   kernel   top   

not on top of a bondEnvironment
  • Red Hat Enterprise Linux 7
  • NetworkManager
Issue
  • Need an 802.1q VLAN in RHEL 7 when using NetworkManager.
Resolution
  • Remove any existing connection profiles for the interface which will have the VLAN(s). Assuming this interface is eth0:

    # for connection in $(nmcli -t --fields name,device connection | awk -F ":" ‘($2 ~ "eth0") {print $1}‘) ; do nmcli connection delete $connection ; done
  • Create a profile for the underlying interface with no IP addressing assigned:

    # nmcli connection add type ethernet ifname eth0 con-name eth0# nmcli connection modify eth0 ipv4.method disabled ipv6.method ignore# nmcli connection up eth0
  • Create a VLAN on top of eth0 with the IP addressing. The following assumes a VLAN ID of 10. Use either DHCP or set a static IP address:

    ### Using DHCP for IP addressing:# nmcli connection add type vlan ifname eth0.10 con-name eth0.10 id 10 dev eth0### With a static IP of  192.168.1.10/24 and gateway of 192.168.1.1:# nmcli connection add type vlan ifname eth0.10 con-name eth0.10 id 10 dev eth0 ip4 192.168.1.10/24 gw4 192.168.1.1
  • If using static addressing, you may want to also set DNS name server entries:

    # nmcli connection modify eth0.10 ipv4.dns 8.8.8.8
on top of a bondEnvironment
  • Red Hat Enterprise Linux 7
  • NetworkManager
Issue
  • Need an 802.1q VLAN on top of a bond in RHEL 7 when using NetworkManager.
Notice
  • There is a bug on RHEL 7.0, and the problem is fixed in RHEL 7.1 kernel.
Resolution

  The following instructions assume that eth0 and eth1 are the names of the interfaces to be used as the bond slaves.

  • Remove any existing connection profiles for the interfaces which will be used as the bond slaves:
# for connection in $(nmcli -t --fields name,device connection | awk -F ":" ‘($2 ~ "eth{0,1}") {print $1}‘) ; do nmcli connection delete $connection ; done# nmcli connection reload
  • Create a bond with no IP addressing assigned:
# nmcli connection add type bond ifname bond0 con-name bond0 mode active-backup miimon 100# nmcli connection modify bond0 ipv4.method disabled# nmcli connection modify bond0 ipv6.method ignore# nmcli connection add type bond-slave ifname eth0 con-name eth0 master bond0# nmcli connection add type bond-slave ifname eth1 con-name eth1 master bond0# nmcli connection up bond0
  • Create a VLAN on top of bond0 with the IP addressing. The following assumes a VLAN ID of 10. Use either DHCP or set a static IP address:
### Using DHCP for IP addressing:# nmcli connection add type vlan ifname bond0.10 con-name bond0.10 id 10 dev bond0### With a static IP of  192.168.1.10/24 and gateway of 192.168.1.1:# nmcli connection add type vlan ifname bond0.10 con-name bond0.10 id 10 dev bond0 ip4 192.168.1.10/24 gw4 192.168.1.1
  • If using static addressing, you may want to also set DNS name server entries:
# nmcli connection modify bond0.10 ipv4.dns 8.8.8.8

 

Configure a VLAN (on top of a bond) with NetworkManager (nmcli) in RHEL7

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.