mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 10:02:09 +08:00
增加 macvtap 模式支持
This commit is contained in:
@@ -1,18 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################
|
||||
# Set up Ethernet bridge on Linux
|
||||
# Requires: bridge-utils
|
||||
#################################
|
||||
|
||||
#yum install bridge-utils
|
||||
|
||||
# Define Bridge Interface
|
||||
br="anylink0"
|
||||
|
||||
# Define physical ethernet interface to be bridged
|
||||
# with TAP interface(s) above.
|
||||
|
||||
# 请根据sever服务器信息,更新下面的信息
|
||||
eth="eth0"
|
||||
eth_ip="192.168.10.4/24"
|
||||
eth_broadcast="192.168.10.255"
|
||||
@@ -24,10 +17,10 @@ brctl addif $br $eth
|
||||
|
||||
ip addr del $eth_ip dev $eth
|
||||
ip addr add 0.0.0.0 dev $eth
|
||||
ip link set dev $eth ip promisc on
|
||||
ip link set dev $eth up promisc on
|
||||
|
||||
mac=`cat /sys/class/net/$eth/address`
|
||||
ip link set up address $mac dev $br
|
||||
ip link set dev $br up address $mac promisc on
|
||||
ip addr add $eth_ip broadcast $eth_broadcast dev $br
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user