Skip to Content
可编程网络自动化
book

可编程网络自动化

by Jason Edelman, Scott S. Lowe, Matt Oswalt
January 2023
Intermediate to advanced
458 pages
14h 16m
Chinese
Posts & Telecom Press
Content preview from 可编程网络自动化
400
附录
A
听起来似乎有点儿深奥,不过该功能在某些用例中能派上用场,助你一臂之力,下面来见
识一下。
A.1.1
 
macvlan
接口用例
目前,
macvlan
接口有以下两种用例。
如果要整合主机,同时希望保留要淘汰的主机
MAC
地址和
IP
地址
,那么可以在新主
机上将这些接口重新创建为
macvlan
接口
。这允许服务继续运行,无须任何改动,即便
服务现在运行在其他主机上。
如果不需要
Linux
网桥的全部功能
,则可以使用
macvlan
接口取代传统的
Linux
网桥。
下一节和本附录随后部分会讲两个相关的例子。
了解过
macvlan
接口的用法,接下来我们将深入介绍一些具体的技术细节。
A.1.2
 创建
配置和删除
macvlan
接口
要创建
macvlan
接口,还得使用
ip
命令,具体来说,是
ip link
命令。该命令用于添加
macvlan
接口的一般语法为
ip link add link
parent-device macvlan-device
type macvlan
parent-device
是新的
macvlan
接口应该关联的物理接口。这也被称为
lower device
macvlan-device
是新的
macvlan
逻辑接口的名称。不像
VLAN
接口,该名称没有什么既
定的命名惯例。
假设你想在
CentOS
系统中创建一个
macvlan
接口
,并将这个新的逻辑接口链接到物理接
ens33
。命令如下所示。
[vagrant@centos ~]$
ip link add link ens33 macvlan0 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python和NLTK实现自然语言处理

Python和NLTK实现自然语言处理

Posts & Telecom Press, Nitin Hardeniya
Go程序设计语言

Go程序设计语言

艾伦A. A.多诺万, 布莱恩W. 柯尼汉
弱监督学习实用指南

弱监督学习实用指南

Wee Hyong Tok, Amit Bahree, Senja Filipi
Python实用技能学习指南

Python实用技能学习指南

Posts & Telecom Press, Robert Smallshire, Austin Bingham

Publisher Resources

ISBN: 9787115606181