bridge-init.sh 552 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. #yum install bridge-utils
  3. # Define Bridge Interface
  4. br="anylink0"
  5. # 请根据sever服务器信息,更新下面的信息
  6. eth="eth0"
  7. eth_ip="192.168.10.4/24"
  8. eth_broadcast="192.168.10.255"
  9. eth_gateway="192.168.10.1"
  10. brctl addbr $br
  11. brctl addif $br $eth
  12. ip addr del $eth_ip dev $eth
  13. ip addr add 0.0.0.0 dev $eth
  14. ip link set dev $eth up promisc on
  15. mac=`cat /sys/class/net/$eth/address`
  16. ip link set dev $br up address $mac promisc on
  17. ip addr add $eth_ip broadcast $eth_broadcast dev $br
  18. route add default gateway $eth_gateway