OpenVPN网桥模式实现LAN-TO-LAN

1 配置如下:

[[email protected] config]# cat  server.conf

local 172.18.1.132

port 3889

proto udp

dev tap0

ca /root/openvpn-2.3.3/config/ca.crt

cert /root/openvpn-2.3.3/config/VPNS.crt

key /root/openvpn-2.3.3/config/VPNS.key  # This file should be kept secret

dh /root/openvpn-2.3.3/config/dh2048.pem

ifconfig-pool-persist /root/openvpn/config/ipp.txt

push "route 192.168.40.0 255.255.255.0" #推送服务端LAN路由

server-bridge 10.8.0.2 255.255.255.0 10.8.0.10 10.8.0.254 #设置隧道服务地址,以及客户端的地址池

client-to-client

duplicate-cn

keepalive 10 120

tls-auth /root/openvpn-2.3.3/config/ta.key 0 # This file is secret

cipher AES-128-CBC   # AES

comp-lzo

max-clients 100

user nobody

group nobody

persist-key

persist-tun

verb 3

mute 20

[[email protected] config]# cat client.conf

client

dev tap

proto udp

remote 172.18.1.132 3889

resolv-retry infinite

nobind

user nobody

group nobody

persist-key

persist-tun

reneg-sec 28800 #秘钥8小时重新协商

ca /root/openvpn-2.3.3/config/ca.crt

cert /root/openvpn-2.3.3/config/user1.crt

key  /root/openvpn-2.3.3/config/user1.key

tls-auth  /root/openvpn-2.3.3/config/ta.key 1

ns-cert-type server

cipher AES-128-CBC

comp-lzo

verb 3

mute 20

2 修改sample-scripts下的网桥脚本:

[[email protected] sample-scripts]# cat bridge-start

#!/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="eth1" #服务器LAN网口

eth_ip="10.8.0.2"

eth_netmask="255.255.255.0"

eth_broadcast="10.8.0.255" #缺省广播地址

for t in $tap; do

openvpn --mktun --dev $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

[[email protected] sample-scripts]# cat bridge-stop

#!/bin/sh

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

# Tear Down Ethernet bridge on Linux

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

# Define Bridge Interface

br="br0"

# Define list of TAP interfaces to be bridged together

tap="tap0"

ifconfig $br down

brctl delbr $br

for t in $tap; do

openvpn --rmtun --dev $t

done

3 启动程序:

先启动bridge-start,然后再启动vpnserver

[[email protected] config]# ifconfig

br0       Link encap:Ethernet  HWaddr 00:0C:29:8C:24:CA

inet addr:10.8.0.2  Bcast:10.8.0.255  Mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe8c:24ca/64 Scope:Link

UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

RX packets:133 errors:0 dropped:0 overruns:0 frame:0

TX packets:43 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:18653 (18.2 KiB)  TX bytes:3366 (3.2 KiB)

eth0      Link encap:Ethernet  HWaddr 00:0C:29:8C:24:C0

inet addr:172.18.1.132  Bcast:172.18.1.255  Mask:255.255.254.0

inet6 addr: fe80::20c:29ff:fe8c:24c0/64 Scope:Link

UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

RX packets:51116 errors:0 dropped:0 overruns:0 frame:0

TX packets:19852 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:7844729 (7.4 MiB)  TX bytes:7488984 (7.1 MiB)

Interrupt:19 Base address:0x2000

lo        Link encap:Local Loopback

inet addr:127.0.0.1  Mask:255.0.0.0

inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING  MTU:65536  Metric:1

RX packets:5 errors:0 dropped:0 overruns:0 frame:0

TX packets:5 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)

tap0      Link encap:Ethernet  HWaddr 8E:6A:1A:B7:E2:0F

inet6 addr: fe80::8c6a:1aff:feb7:e20f/64 Scope:Link

UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1

RX packets:80 errors:0 dropped:0 overruns:0 frame:0

TX packets:65 errors:0 dropped:12 overruns:0 carrier:0

collisions:0 txqueuelen:100

RX bytes:6224 (6.0 KiB)  TX bytes:10182 (9.9 KiB)

结束时先断开server,然后再bridge-stop

请注意,这种桥接方式启动的OpenVPN服务器上的tap0虚拟网卡没有IP地址,因为整个过程没有IP层的内容。

4 打印信息如下:

服务器

[[email protected] config]# /usr/local/sbin/openvpn  --config /root/openvpn-2.3.3/config/server.conf

Tue Sep  5 00:34:38 2017 OpenVPN 2.3.3 x86_64-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Aug 31 2017

Tue Sep  5 00:34:38 2017 NOTE: when bridging your LAN adapter with the TAP adapter, note that the new bridge adapter will often take on its own IP address that is different from what the LAN adapter was previously set to

Tue Sep  5 00:34:38 2017 WARNING: --ifconfig-pool-persist will not work with --duplicate-cn

Tue Sep  5 00:34:38 2017 Diffie-Hellman initialized with 2048 bit key

Tue Sep  5 00:34:38 2017 Control Channel Authentication: using ‘/root/openvpn-2.3.3/config/ta.key‘ as a OpenVPN static key file

Tue Sep  5 00:34:38 2017 Outgoing Control Channel Authentication: Using 160 bit message hash ‘SHA1‘ for HMAC authentication

Tue Sep  5 00:34:38 2017 Incoming Control Channel Authentication: Using 160 bit message hash ‘SHA1‘ for HMAC authentication

Tue Sep  5 00:34:38 2017 Socket Buffers: R=[124928->131072] S=[124928->131072]

Tue Sep  5 00:34:38 2017 TUN/TAP device tap0 opened

Tue Sep  5 00:34:38 2017 TUN/TAP TX queue length set to 100

Tue Sep  5 00:34:38 2017 GID set to nobody

Tue Sep  5 00:34:38 2017 UID set to nobody

Tue Sep  5 00:34:38 2017 UDPv4 link local (bound): [AF_INET]172.18.1.132:3889

Tue Sep  5 00:34:38 2017 UDPv4 link remote: [undef]

Tue Sep  5 00:34:38 2017 MULTI: multi_init called, r=256 v=256

Tue Sep  5 00:34:38 2017 IFCONFIG POOL: base=10.8.0.10 size=245, ipv6=0

Tue Sep  5 00:34:38 2017 IFCONFIG POOL LIST

Tue Sep  5 00:34:38 2017 Initialization Sequence Completed

Tue Sep  5 00:34:43 2017 172.18.1.130:39446 TLS: Initial packet from [AF_INET]172.18.1.130:39446, sid=aae8c845 f1d49e60

Tue Sep  5 00:34:43 2017 172.18.1.130:39446 VERIFY OK: depth=1, C=CN, ST=GD, L=SZ, O=softown, OU=softown_admin, CN=OpenVPN_CA, name=EasyRSA, [email protected]

Tue Sep  5 00:34:43 2017 172.18.1.130:39446 VERIFY OK: depth=0, C=CN, ST=GD, L=SZ, O=softown, OU=softown_admin, CN=user1, name=EasyRSA, [email protected]

Tue Sep  5 00:34:43 2017 172.18.1.130:39446 Data Channel Encrypt: Cipher ‘AES-128-CBC‘ initialized with 128 bit key

Tue Sep  5 00:34:43 2017 172.18.1.130:39446 Data Channel Encrypt: Using 160 bit message hash ‘SHA1‘ for HMAC authentication

Tue Sep  5 00:34:43 2017 172.18.1.130:39446 Data Channel Decrypt: Cipher ‘AES-128-CBC‘ initialized with 128 bit key

Tue Sep  5 00:34:43 2017 172.18.1.130:39446 Data Channel Decrypt: Using 160 bit message hash ‘SHA1‘ for HMAC authentication

Tue Sep  5 00:34:43 2017 172.18.1.130:39446 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA384, 2048 bit RSA

Tue Sep  5 00:34:43 2017 172.18.1.130:39446 [user1] Peer Connection Initiated with [AF_INET]172.18.1.130:39446

Tue Sep  5 00:34:43 2017 user1/172.18.1.130:39446 MULTI_sva: pool returned IPv4=10.8.0.10, IPv6=(Not enabled)

Tue Sep  5 00:34:46 2017 user1/172.18.1.130:39446 PUSH: Received control message: ‘PUSH_REQUEST‘

Tue Sep  5 00:34:46 2017 user1/172.18.1.130:39446 send_push_reply(): safe_cap=940

Tue Sep  5 00:34:46 2017 user1/172.18.1.130:39446 SENT CONTROL [user1]: ‘PUSH_REPLY,route 192.168.40.0 255.255.255.0,route-gateway 10.8.0.2,ping 10,ping-restart 120,ifconfig 10.8.0.10 255.255.255.0‘ (status=1)

Tue Sep  5 00:34:46 2017 user1/172.18.1.130:39446 MULTI: Learn: 3e:9f:94:51:1b:9c -> user1/172.18.1.130:39446

客户端

[[email protected] ~]# /usr/local/sbin/openvpn  --config /root/openvpn-2.3.3/config/client.conf

Tue Sep  5 00:33:39 2017 OpenVPN 2.3.3 x86_64-unknown-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on Aug 31 2017

Tue Sep  5 00:33:39 2017 Control Channel Authentication: using ‘/root/openvpn-2.3.3/config/ta.key‘ as a OpenVPN static key file

Tue Sep  5 00:33:39 2017 Outgoing Control Channel Authentication: Using 160 bit message hash ‘SHA1‘ for HMAC authentication

Tue Sep  5 00:33:39 2017 Incoming Control Channel Authentication: Using 160 bit message hash ‘SHA1‘ for HMAC authentication

Tue Sep  5 00:33:39 2017 Socket Buffers: R=[124928->131072] S=[124928->131072]

Tue Sep  5 00:33:39 2017 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay

Tue Sep  5 00:33:39 2017 UDPv4 link local: [undef]

Tue Sep  5 00:33:39 2017 UDPv4 link remote: [AF_INET]172.18.1.132:3889

Tue Sep  5 00:33:39 2017 TLS: Initial packet from [AF_INET]172.18.1.132:3889, sid=f5c08706 546e7dad

Tue Sep  5 00:33:39 2017 VERIFY OK: depth=1, C=CN, ST=GD, L=SZ, O=softown, OU=softown_admin, CN=OpenVPN_CA, name=EasyRSA, [email protected]

Tue Sep  5 00:33:39 2017 VERIFY OK: nsCertType=SERVER

Tue Sep  5 00:33:39 2017 VERIFY OK: depth=0, C=CN, ST=GD, L=SZ, O=softown, OU=softown_admin, CN=VPNS, name=EasyRSA, [email protected]

Tue Sep  5 00:33:39 2017 Data Channel Encrypt: Cipher ‘AES-128-CBC‘ initialized with 128 bit key

Tue Sep  5 00:33:39 2017 Data Channel Encrypt: Using 160 bit message hash ‘SHA1‘ for HMAC authentication

Tue Sep  5 00:33:39 2017 Data Channel Decrypt: Cipher ‘AES-128-CBC‘ initialized with 128 bit key

Tue Sep  5 00:33:39 2017 Data Channel Decrypt: Using 160 bit message hash ‘SHA1‘ for HMAC authentication

Tue Sep  5 00:33:39 2017 Control Channel: TLSv1.2, cipher TLSv1/SSLv3 DHE-RSA-AES256-GCM-SHA384, 2048 bit RSA

Tue Sep  5 00:33:39 2017 [VPNS] Peer Connection Initiated with [AF_INET]172.18.1.132:3889

Tue Sep  5 00:33:41 2017 SENT CONTROL [VPNS]: ‘PUSH_REQUEST‘ (status=1)

Tue Sep  5 00:33:41 2017 PUSH: Received control message: ‘PUSH_REPLY,route 192.168.40.0 255.255.255.0,route-gateway 10.8.0.2,ping 10,ping-restart 120,ifconfig 10.8.0.10 255.255.255.0‘

Tue Sep  5 00:33:41 2017 OPTIONS IMPORT: timers and/or timeouts modified

Tue Sep  5 00:33:41 2017 OPTIONS IMPORT: --ifconfig/up options modified

Tue Sep  5 00:33:41 2017 OPTIONS IMPORT: route options modified

Tue Sep  5 00:33:41 2017 OPTIONS IMPORT: route-related options modified

Tue Sep  5 00:33:41 2017 ROUTE_GATEWAY 172.18.1.254/255.255.254.0 IFACE=eth0 HWADDR=00:0c:29:b5:22:a8

Tue Sep  5 00:33:41 2017 TUN/TAP device tap0 opened

Tue Sep  5 00:33:41 2017 TUN/TAP TX queue length set to 100

Tue Sep  5 00:33:41 2017 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0

Tue Sep  5 00:33:41 2017 /sbin/ifconfig tap0 10.8.0.10 netmask 255.255.255.0 mtu 1500 broadcast 10.8.0.255

Tue Sep  5 00:33:41 2017 /sbin/route add -net 192.168.40.0 netmask 255.255.255.0 gw 10.8.0.2

Tue Sep  5 00:33:41 2017 GID set to nobody

Tue Sep  5 00:33:41 2017 UID set to nobody

Tue Sep  5 00:33:41 2017 Initialization Sequence Completed

5 添加客户端路由

服务端:ip route add 192.168.20.0/24 dev br0 或 ip route add 192.168.20.0/24 via 10.8.0.2

6 测试
服务器 -> 客户端

[[email protected] config]# ping 10.8.0.10 #ping客户端隧道地址

PING 10.8.0.10 (10.8.0.10) 56(84) bytes of data.

64 bytes from 10.8.0.10: icmp_seq=1 ttl=64 time=0.580 ms

64 bytes from 10.8.0.10: icmp_seq=2 ttl=64 time=0.877 ms

64 bytes from 10.8.0.10: icmp_seq=3 ttl=64 time=0.891 ms

64 bytes from 10.8.0.10: icmp_seq=4 ttl=64 time=0.861 ms

^C

--- 10.8.0.10 ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3511ms

rtt min/avg/max/mdev = 0.580/0.802/0.891/0.130 ms

[[email protected] config]# ping 192.168.20.20 #ping客户端LAN地址

PING 192.168.20.20 (192.168.20.20) 56(84) bytes of data.

64 bytes from 192.168.20.20: icmp_seq=1 ttl=64 time=16.5 ms

64 bytes from 192.168.20.20: icmp_seq=2 ttl=64 time=0.472 ms

64 bytes from 192.168.20.20: icmp_seq=3 ttl=64 time=0.504 ms

64 bytes from 192.168.20.20: icmp_seq=4 ttl=64 time=0.439 ms

^C

--- 192.168.20.20 ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3477ms

rtt min/avg/max/mdev = 0.439/4.487/16.533/6.954 ms

[[email protected] ~]# ping  -I 192.168.40.40  192.168.20.20 #服务器LAN地址ping客户端LAN地址

PING 192.168.20.20 (192.168.20.20) from 192.168.40.40 : 56(84) bytes of data.

64 bytes from 192.168.20.20: icmp_seq=1 ttl=64 time=0.565 ms

64 bytes from 192.168.20.20: icmp_seq=2 ttl=64 time=0.987 ms

64 bytes from 192.168.20.20: icmp_seq=3 ttl=64 time=0.954 ms

64 bytes from 192.168.20.20: icmp_seq=4 ttl=64 time=0.920 ms

^C

--- 192.168.20.20 ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3830ms

rtt min/avg/max/mdev = 0.565/0.856/0.987/0.172 ms

客户端 -> 服务器

[[email protected] config]# ping  10.8.0.2 #ping服务端隧道

PING 10.8.0.2 (10.8.0.2) 56(84) bytes of data.

64 bytes from 10.8.0.2: icmp_seq=1 ttl=64 time=0.977 ms

64 bytes from 10.8.0.2: icmp_seq=2 ttl=64 time=0.872 ms

64 bytes from 10.8.0.2: icmp_seq=3 ttl=64 time=0.969 ms

64 bytes from 10.8.0.2: icmp_seq=4 ttl=64 time=0.761 ms

^C

--- 10.8.0.2 ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3609ms

rtt min/avg/max/mdev = 0.761/0.894/0.977/0.094 ms

[[email protected] config]# ping  192.168.40.40 #ping服务端LAN地址

PING 192.168.40.40 (192.168.40.40) 56(84) bytes of data.

64 bytes from 192.168.40.40: icmp_seq=1 ttl=64 time=0.645 ms

64 bytes from 192.168.40.40: icmp_seq=2 ttl=64 time=0.981 ms

64 bytes from 192.168.40.40: icmp_seq=3 ttl=64 time=0.879 ms

64 bytes from 192.168.40.40: icmp_seq=4 ttl=64 time=1.03 ms

^C

--- 192.168.40.40 ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3475ms

rtt min/avg/max/mdev = 0.645/0.884/1.031/0.148 ms

[[email protected] ~]# ping  -I  192.168.20.20 192.168.40.40 #客户端LAN地址ping服务端LAN地址

PING 192.168.40.40 (192.168.40.40) from 192.168.20.20 : 56(84) bytes of data.

64 bytes from 192.168.40.40: icmp_seq=1 ttl=64 time=1.56 ms

64 bytes from 192.168.40.40: icmp_seq=2 ttl=64 time=0.790 ms

64 bytes from 192.168.40.40: icmp_seq=3 ttl=64 time=0.742 ms

64 bytes from 192.168.40.40: icmp_seq=4 ttl=64 time=0.847 ms

^C

--- 192.168.40.40 ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3159ms

rtt min/avg/max/mdev = 0.742/0.986/1.567/0.338 ms

7 写一个自启动脚本

#!/bin/bash

#

# openvpn This shell script takes care of starting and stopping

# chkconfig: 345 90 20

#

# description: openvpn is the NTPv4 daemon.

. /etc/init.d/functions

prog=openvpn

lockfile=/var/lock/subsys/$prog

start() {

[ -x /usr/local/sbin/openvpn ] || exit 5

/usr/sbin/bridge-start

# Start daemons.

echo -n $"Starting $prog................ "

/usr/local/sbin/openvpn --daemon  --config /root/openvpn-2.3.3/config/server.conf

RETVAL=$?

echo

[ $RETVAL -eq 0 ] && touch $lockfile

return $RETVAL

}

stop() {

echo -n $"Shutting down $prog............... "

killproc $prog

RETVAL=$?

echo

[ $RETVAL -eq 0 ] && rm -f $lockfile

/usr/sbin/bridge-stop

return $RETVAL

}

# See how we were called.

case "$1" in

start)

start

;;

stop)

stop

;;

status)

status $prog

;;

reload)

stop

start

;;

*)

echo $"Usage: $0 {start|stop|status|reload}"

exit 2

esac

[[email protected] ~]# /etc/init.d/openvpn

Usage: /etc/init.d/openvpn {start|stop|status|reload}

start:

[[email protected] ~]# /etc/init.d/openvpn start

Tue Sep 12 00:22:13 2017 TUN/TAP device tap0 opened

Tue Sep 12 00:22:13 2017 Persist state set to: ON

Starting openvpn................

[[email protected] ~]# ps -ef|grep openvpn

root       1656      1  0 00:22 ?        00:00:00 /usr/local/sbin/openvpn --daemon --config /root/openvpn-2.3.3/config/server.conf

stop:

[[email protected] ~]# /etc/init.d/openvpn stop

Shutting down openvpn...............                       [  OK  ]

Tue Sep 12 00:22:09 2017 TUN/TAP device tap0 opened

Tue Sep 12 00:22:09 2017 Persist state set to: OFF

status:

[[email protected] ~]# /etc/init.d/openvpn status

openvpn (pid 1923) is running...

reload:

[[email protected] ~]# /etc/init.d/openvpn reload

Shutting down openvpn...............                       [  OK  ]

Tue Sep 12 00:23:54 2017 TUN/TAP device tap0 opened

Tue Sep 12 00:23:54 2017 Persist state set to: OFF

Tue Sep 12 00:23:54 2017 TUN/TAP device tap0 opened

Tue Sep 12 00:23:54 2017 Persist state set to: ON

Starting openvpn................

[[email protected] ~]# chkconfig openvpn  on #加入开机启动

时间: 2025-01-14 03:00:36

OpenVPN网桥模式实现LAN-TO-LAN的相关文章

用openvpn组建lan to lan vpn

利用openvpn组建lan to lan vpn,优势不需要网络设备. 和aws云对接实战: 一.linux做open server 安装gcc.openssl.lzo 1.yum install openssl* 2. yum install gcc 3.下载lzo http://www.oberhumer.com/opensource/lzo/download/最新版 http://www.oberhumer.com/opensource/lzo/download/lzo-2.09.tar

Linux网桥模式配置

Linux网关模式下将有线LAN和无线LAN共享网段实现局域网内互联: 思路其实很简单:就是将虚拟出一个bridge口,将对应的有线LAN和无线LAN都绑定在这个虚拟bridge口上,并给这个bridge口分配一个地址,其他子网微机配置网关为bridge口的地址便可以了.当然,因为是设备是网关模式,路由和nat也是必须的了.如果设备本身便是网桥模式,那么路由和nat便可以省掉了. brctl addbr bridge brctl addif bridge eth0 brctl addif bri

Linux网卡设置为网桥模式

Linux网卡设置为网桥模式 1.    添加网卡,并修改相关配置文件 1.1虚拟机添加网卡,并配置相关文件 如:eth2为新添加网卡 cd /etc/sysconfig/network-scripts cp ifcfg-eth1 ifcfg-eth2 vi ifcfg-eth2 TYPE=Ethernet BOOTPROTO=none DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_

烂泥:openvpn tun模式下客户端与内网机器通信

本文由秀依林枫提供友情赞助,首发于烂泥行天下 前两篇文章我们介绍了有关openvpn的搭建与配置文件的讲解,这篇文章我们再聊介绍下,在tun模式下openvpn客户端如何与内网机器通信的问题. 一.实际问题 先来介绍下目前的基本情况,如下: 1.openvpn服务器单网卡,通过硬件防火墙把openvpn服务器的1194端口映射到公网. 2.openvpn服务器所在的网段为192.168.5.1/24网段 3.openvpn客户端获得IP地址为10.8.0.1/24网段 要求10.8.0.1/24

VMWare虚拟机提供的桥接、nat、仅主机模式、自定义、LAN区段的用法

前言: 想必大家对vmware workstation一定很熟悉了吧?但你是否玩的很6呢?今天和大家简单谈谈这些老技术的用法. 种类: 1.桥接 2.NAT 3.仅主机模式 4.自定义 5.LAN区段 用法: 1.桥接: 和局域网的一台pc没有什么区别,配置相同网段的ip(不冲突即可)既可! 2.NAT: 地址转换,电脑默认的vmware8要启用,客户端自动获取ip既可,在虚拟网络编辑器里可以看到其定义的tcp/ip信息.如果不想桥接,或者局域网ip地址不够用或者mac绑定,可以用NAT的模式.

OpenVPN路由模式实现LAN-TO-LAN

1 网络拓扑: 2 配置如下: [[email protected] config]# cat  server.conf local 172.18.1.132 port 3889 proto udp dev tun ca /root/openvpn-2.3.3/config/ca.crt cert /root/openvpn-2.3.3/config/VPNS.crt key /root/openvpn-2.3.3/config/VPNS.key  # This file should be k

居易技术支持 - 设置手册 -VPN - LAN到LAN(路由器到路由器)VPN设置参考

当您有两条Internet线路时,您可能希望您的VPN网络能够使用到您的全部两条线路的带宽,传统的VPN连接方式无法在两个子网间建立多条IPSec连接.而是用Vigor路由器提供的VPN负载平衡,则可以轻松实现VPN双线路拨号,同时使用两条线路的带宽,也可以起到双保险的作用(当一条线路有问题时,VPN仍然保持畅通) 本文将为您介绍如何使用Vigor 2960/3900的VPN负载平衡,环境如下: 两台Vigor 2960/3900各有两个WAN上线. 图中GRE IP是可以随意填写的,只要在双方

CentOS 7下OpenVPN SiteToSite模式搭建

相信很多公司都会有多地办公场景,而且多个地区需要能够相互访问,这个最经济的就是使用VPN,当然不缺钱的公司也可以使用专线.在此利用OpenVPN搭建SiteToSite实现多地互访 北京VPN服务器搭建: 1.依赖包的安装,停止firewalld服务,并安装iptables systemctl stop firewalld.service systemctl disable firewalld.service yum -y install iptables-services iptables i

nat模式、路由模式,网桥模式

路由器的几种连接方式 NAT英文全称是"Network Address Translation",中文意思是"网络地址转换",它是一个IETF(Internet Engineering Task Force, Internet工程任务组)标准,允许一个整体机构以一个公用IP(Internet Protocol)地址出现在Internet上.顾名思义,它是一种把内部私有网络地址(IP地址)翻译成合法网络IP地址的技术. 简单的说,NAT就是在局域网内部网络中使用内部地