实操《kubernetes网络权威指南》之veth pair

https://book.douban.com/subject/34855927/

作者: 杜军 
出版社: 电子工业出版社
出品方: 博文视点
出版年: 2019-10
页数: 348
定价: 89
ISBN: 9787121373398

# 新建一个network Namespace
ip netns add netns1

# 新建一对veth
ip link add veth0 type veth peer name veth1

# 将veh1 移入到network namespace netns1
link set veth1 netns netns1

# 配置并激活netns1中的veth1
ip netns exec netns1 ifconfig veth1 10.1.1.1/24 up

# 配置并激活主namespace中的veth0
ifconfig veth0 10.1.1.2/24 up

# veth之间可相互ping通
ip netns exec netns1 ping 10.1.1.2

ping 10.1.1.1

猜你喜欢

转载自www.cnblogs.com/aguncn/p/11877832.html