mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 15:29:09 +08:00
更改目录结构
This commit is contained in:
38
server/bridge-init.sh
Normal file
38
server/bridge-init.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
#################################
|
||||
# Set up Ethernet bridge on Linux
|
||||
# Requires: bridge-utils
|
||||
#################################
|
||||
|
||||
# Define Bridge Interface
|
||||
br="anylink0"
|
||||
|
||||
# Define physical ethernet interface to be bridged
|
||||
# with TAP interface(s) above.
|
||||
|
||||
eth="eth0"
|
||||
eth_ip="192.168.10.4"
|
||||
eth_netmask="255.255.255.0"
|
||||
eth_broadcast="192.168.10.255"
|
||||
eth_gateway="192.168.10.1"
|
||||
|
||||
|
||||
brctl addbr $br
|
||||
brctl addif $br $eth
|
||||
|
||||
ifconfig $eth 0.0.0.0 up
|
||||
|
||||
mac=`cat /sys/class/net/$eth/address`
|
||||
ifconfig $br hw ether $mac
|
||||
ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast up
|
||||
|
||||
route add default gateway $eth_gateway
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user