CentOS建立桥接几分钟后死机

#!/bin/sh

#################################

# Set up Ethernet bridge on Linux

# Requires: bridge-utils

#################################

# Define Bridge Interface

br="br0"

# Define list of TAP interfaces to be bridged,

# for example tap="tap0 tap1 tap2".

tap="tap0"

# Define physical ethernet interface to be bridged

# with TAP interface(s) above.

eth="eth0"

eth_ip="172.19.191.162"            //我的服务器局域网地址 ifconfig获取的eth0

eth_netmask="255.255.240.0" 

eth_broadcast="172.19.191.255"

for t in $tap; do

    openvpn --mktun --dev $t

    echo $t

done

brctl addbr $br

brctl addif $br $eth

for t in $tap; do

    brctl addif $br $t

done

for t in $tap; do

    ifconfig $t 0.0.0.0 promisc up

done

#ifconfig $eth 0.0.0.0 promisc up          //原脚本有此命令,我给注销了

ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容