[root@localhost src]# gzip -dc openvpn-2.1.1-ipv6-0.4.10.patch.gz | patch –p1
ifconfig eth0 add 2005::4/64
route –A inet6 add default gw 2005::1
加入 /etc/rc.d/rc.local
cp /etc/sysconfig/network-script/ifcfg-eth0 /etc/sysconfig/network-script/ifcfg-eth0:1
Change device eth0 ==>eth0:1
OpenVPN 2.1.1 use bridge (TAP Driver)
dev tap0 (根据实际情况调整。)
Server-bridge 192.168.8.4 255.255.255.0 192.168.8.20 192.168.8.250
————————————— —————— ——————–
| | |
服务端的IP地址和掩码 客户端分配的开始范围
如果启用了防火墙(Iptables)
iptables -A INPUT -i tap0 -j ACCEPT
iptables -A INPUT -i br0 -j ACCEPT
iptables -A FORWARD -i br0 -j ACCEPT
[root@localhost sample-scripts]# cat bridge-start
#!/bin/bash
#################################
# 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="eth1"
eth_ip="192.168.8.4"
eth_netmask="255.255.255.0"
eth_broadcast="192.168.8.255"
eth_ipv6="2005::1/64"
for t in $tap; do
openvpn –mktun –dev $t
done
/usr/sbin/brctl addbr $br
/usr/sbin/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
ifconfig $br add $eth_ipv6