Linux 创建虚拟接口

1、创建dummy接口

ip link add dummy1 type dummy

ip link set dummy1 arp on

ip address add 10.0.2.2/24 broadcast + dev dummy1

ip link set dummy1 up

 

2、创建桥接接口

ip link add dummy1 type dummy

ip link add dummy2 type dummy

ip link add dummy-br0 type bridge

ip link set dummy1 arp on

ip link set dummy2 arp on

ip link set dev dummy1 master dummy-br0

ip link set dev dummy2 master dummy-br0

ip address add 10.0.2.1/24 broadcast + dev dummy-br0

ip address add 10.0.2.2/24 broadcast + dev dummy1

ip address add 10.0.2.3/24 broadcast + dev dummy2

ip link set dummy1 up

ip link set dummy2 up

ip link set dummy-br0 up

你可能感兴趣的:(Linux)