Tek ortak IP NIC ile köprülü OpenVPN sunucusunu ayarlama


6

Bir şey kurmaya çalışıyorum köprülü OpenVPN sunucusu çok başarılı olamadı. Ubuntu'yu çalıştıran statik bir IP atayan bir NIC ile çalışan VPS'im var. Bağlanacak ve birkaç yayın yapan normal bir LAN gibi çalışacak bir ağ oluşturacak bir kaç müşterim olmasını istiyorum.

Fiziksel bağlantıların şeması: Physical network connections

sahip olmak isterdim laptop ve desktop ve server tek bir ağda diyelim ki 10.0.0.0/24. Aşağıdaki yapılandırma ile sadece OpenVPN sunucusuna bağlanabildim, ancak makineler arasında gerçek bir bağlantı yok. Çalıştırdığım en uzak şey server sadece görebilir ARP istemcilerden gelen istemcilerden talep alır, ancak herhangi bir yanıt göndermez. Ping yapamam server herhangi bir müşteriden, herhangi bir müşteriden server. Belli ki yanlış bir şey yapıyorum ama parmağımı buna sokamam. Lütfen, bir yerde yazım hatası olduğunu söyle.

server arayüzleri:

root@server:~# cat /etc/network/interfaces    
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual
  up ip link set $IFACE addr f2:3c:91:69:33:c2 promisc on up
  down ip link set $IFACE down

auto tap0
iface tap0 inet manual
  pre-up openvpn --mktun --dev $IFACE
  up ip link set $IFACE addr f2:3c:91:69:33:c1 promisc on up
  down ip link set $IFACE down
  post-down openvpn --rmtun --dev $IFACE

auto br0
iface br0 inet dhcp
  bridge_ports eth0 tap0
  bridge_fd 0
  bridge_stp off
  pre-up ip link set $IFACE addr f2:3c:91:69:33:c3 # DHCP filters by MAC

server IPv4 iletme etkin:

root@server:~# sysctl -p
net.ipv4.ip_forward = 1

server yapılandırma:

proto         udp
dev           tap0
port          1194
local         vpn.server.tld

server-bridge 10.0.0.2 255.255.255.0 10.0.0.128 10.0.0.254
push          "route 10.0.0.0 255.255.255.0"
client-to-client

ca            keys/ca.crt
cert          keys/server.crt
key           keys/server.key
dh            keys/dh1024.pem
tls-server
tls-auth      keys/ta.key 0

user          nobody
group         nogroup
persist-key
persist-tun

keepalive     10 60
comp-lzo

status        /var/log/openvpn.status
log           /var/log/openvpn.log
verb          3

desktop yapılandırma:

client
proto        udp
dev          tap
port         20251 # forwarded in office router
remote       vpn.server.tld 1194

ca           ../keys/ca.crt
cert         ../keys/tomasz@desktop.crt
key          ../keys/tomasz@desktop.key
tls-client
tls-auth     ../keys/ta.key 1
ns-cert-type server

persist-key
persist-tun

keepalive    10 60
comp-lzo
resolv-retry infinite

server bağlantı günlüğü:

root@server:~# tail -n 40 -f /var/log/openvpn.log
Sat Jul 27 00:32:30 2013 OpenVPN 2.2.1 x86_64-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Feb 13 2013
Sat Jul 27 00:32:30 2013 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
Sat Jul 27 00:32:30 2013 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Sat Jul 27 00:32:30 2013 Diffie-Hellman initialized with 1024 bit key
Sat Jul 27 00:32:30 2013 Control Channel Authentication: using 'keys/ta.key' as a OpenVPN static key file
Sat Jul 27 00:32:30 2013 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jul 27 00:32:30 2013 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jul 27 00:32:30 2013 TLS-Auth MTU parms [ L:1574 D:166 EF:66 EB:0 ET:0 EL:0 ]
Sat Jul 27 00:32:30 2013 Socket Buffers: R=[212992->131072] S=[212992->131072]
Sat Jul 27 00:32:30 2013 TUN/TAP device tap0 opened
Sat Jul 27 00:32:30 2013 TUN/TAP TX queue length set to 100
Sat Jul 27 00:32:30 2013 Data Channel MTU parms [ L:1574 D:1450 EF:42 EB:135 ET:32 EL:0 AF:3/1 ]
Sat Jul 27 00:32:30 2013 GID set to nogroup
Sat Jul 27 00:32:30 2013 UID set to nobody
Sat Jul 27 00:32:30 2013 UDPv4 link local (bound): [AF_INET]79.123.43.99:1194
Sat Jul 27 00:32:30 2013 UDPv4 link remote: [undef]
Sat Jul 27 00:32:30 2013 MULTI: multi_init called, r=256 v=256
Sat Jul 27 00:32:30 2013 IFCONFIG POOL: base=10.0.0.128 size=127, ipv6=0
Sat Jul 27 00:32:30 2013 Initialization Sequence Completed
Sat Jul 27 00:32:44 2013 MULTI: multi_create_instance called
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 Re-using SSL/TLS context
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 LZO compression initialized
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 Control Channel MTU parms [ L:1574 D:166 EF:66 EB:0 ET:0 EL:0 ]
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 Data Channel MTU parms [ L:1574 D:1450 EF:42 EB:135 ET:32 EL:0 AF:3/1 ]
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 Local Options hash (VER=V4): '360696c5'
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 Expected Remote Options hash (VER=V4): '13a273ba'
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 TLS: Initial packet from [AF_INET]89.77.180.128:20251, sid=d27be456 62dc0bf7
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 VERIFY OK: depth=1, /C=**/ST=**/L=**/O=**/CN=**_Certification_Authority
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 VERIFY OK: depth=0, /C=**/ST=**/L=**/O=**/CN=tomasz@desktop
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA
Sat Jul 27 00:32:44 2013 168.87.4.12:20251 [tomasz@desktop] Peer Connection Initiated with [AF_INET]168.87.4.12:20251
Sat Jul 27 00:32:44 2013 tomasz@desktop/168.87.4.12:20251 MULTI_sva: pool returned IPv4=10.0.0.128, IPv6=1::2100:0:0:0
Sat Jul 27 00:32:46 2013 tomasz@desktop/168.87.4.12:20251 PUSH: Received control message: 'PUSH_REQUEST'
Sat Jul 27 00:32:46 2013 tomasz@desktop/168.87.4.12:20251 send_push_reply(): safe_cap=960
Sat Jul 27 00:32:46 2013 tomasz@desktop/168.87.4.12:20251 SENT CONTROL [tomasz@desktop]: 'PUSH_REPLY,route 10.0.0.0 255.255.255.0,route-gateway 10.0.0.2,ping 10,ping-restart 60,ifconfig 10.0.0.128 255.255.255.0' (status=1)
Sat Jul 27 00:32:47 2013 tomasz@desktop/168.87.4.12:20251 MULTI: Learn: aa:7c:1d:c2:42:e1 -> tomasz@desktop/168.87.4.12:20251

server OpenVPN ile çalışan rotaları ve arayüzleri:

root@remote:~# netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
default         79.123.43.1     0.0.0.0         UG        0 0          0 br0
79.123.43.0     *               255.255.255.0   U         0 0          0 br0

root@server:~# ifconfig
br0       Link encap:Ethernet  HWaddr f2:3c:91:69:33:c3  
          inet addr:79.123.43.99  Bcast:79.123.43.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:450 errors:0 dropped:0 overruns:0 frame:0
          TX packets:467 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:48685 (48.6 KB)  TX bytes:53043 (53.0 KB)

eth0      Link encap:Ethernet  HWaddr f2:3c:91:69:33:c2  
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:20803 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26066 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000   
          RX bytes:2190355 (2.1 MB)  TX bytes:3683757 (3.6 MB)                                                                                                                
          Interrupt:76 

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:1183 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1183 errors:0 dropped:0 overruns:0 carrier:0                                                                                                                    
          collisions:0 txqueuelen:0                                                                                                                                                  
          RX bytes:433649 (433.6 KB)  TX bytes:433649 (433.6 KB)

tap0      Link encap:Ethernet  HWaddr f2:3c:91:69:33:c1  
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:1158 (1.1 KB)  TX bytes:3390 (3.3 KB)

desktop bağlantı günlüğü:

tomasz@desktop:$ sudo openvpn --config desktop.ovpn 
Sat Jul 27 00:58:33 2013 OpenVPN 2.3.2 x86_64-apple-darwin12.4.0 [SSL (OpenSSL)] [LZO] [eurephia] [MH] [IPv6] built on Jul 24 2013
Sat Jul 27 00:58:33 2013 Control Channel Authentication: using '../keys/ta.key' as a OpenVPN static key file
Sat Jul 27 00:58:33 2013 UDPv4 link local (bound): [undef]
Sat Jul 27 00:58:33 2013 UDPv4 link remote: [AF_INET]79.123.43.99:1194
Sat Jul 27 00:58:33 2013 [vpn.server.tld] Peer Connection Initiated with [AF_INET]79.123.43.99:1194
Sat Jul 27 00:58:36 2013 TUN/TAP device /dev/tap0 opened
Sat Jul 27 00:58:36 2013 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sat Jul 27 00:58:36 2013 /sbin/ifconfig tap0 delete
ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address
Sat Jul 27 00:58:36 2013 NOTE: Tried to delete pre-existing tun/tap instance -- No Problem if failure
Sat Jul 27 00:58:36 2013 /sbin/ifconfig tap0 10.0.0.128 netmask 255.255.255.0 mtu 1500 up
route: writing to routing socket: File exists
add net 10.0.0.0: gateway 10.0.0.2: File exists
Sat Jul 27 00:58:36 2013 Initialization Sequence Completed

desktop OpenVPN ile çalışan rotaları ve arayüzleri:

tomasz@desktop$ ifconfig
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 00:26:bb:10:6e:14 
    inet6 fe80::226:bbff:fe10:6e14%en1 prefixlen 64 scopeid 0x5 
    inet 192.168.0.250 netmask 0xffffff00 broadcast 192.168.0.255
    media: autoselect
    status: active
tap0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether aa:7c:1d:c2:42:e1 
    inet 10.0.0.128 netmask 0xffffff00 broadcast 10.0.0.255
    open (pid 14700)    

tomasz@desktop$ netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            192.168.0.1        UGSc           15      760     en1
10/24              link#8             UC              2        0    tap0
10.0.0.255         ff:ff:ff:ff:ff:ff  UHLWbI          0        4    tap0
127                127.0.0.1          UCS             0        0     lo0
127.0.0.1          127.0.0.1          UH              7     1873     lo0
169.254            link#5             UCS             0        0     en1
192.168.0          link#5             UCS             3        0     en1
192.168.0.1        80:c6:ab:cf:61:54  UHLWIir        16     4568     en1    704
192.168.0.250      127.0.0.1          UHS             0        0     lo0
192.168.0.255      ff:ff:ff:ff:ff:ff  UHLWbI          0        4     en1

Ping yapmaya çalışırken server itibaren desktop:

tomasz@desktop:~$ ping -c 1 10.0.0.2
PING 10.0.0.2 (10.0.0.2): 56 data bytes
--- 10.0.0.2 ping statistics ---
1 packets transmitted, 0 packets received, 100.0% packet loss

tomasz@server:~$ sudo tcpdump -nel -i tap0
tcpdump: WARNING: tap0: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tap0, link-type EN10MB (Ethernet), capture size 65535 bytes
01:02:44.023108 8a:13:46:10:03:ac > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Request who-has 10.0.0.2 tell 10.0.0.128, length 28

Yanıtlar:


2

Bence köprülü modda OpenVPN IP'leri dağıtmıyor. Yani bunu yapmak için bir DHCP sunucusu sağlamanız gerekir.


Daha yakından bakmak ... işte düşüncelerim.

Anladım sen varsın tap0 ve eth0 köprüye bağlandı br0? ( brctl doğrulayabilir)

br0 sunucudaki IP'si OpenVPN alt ağında DEĞİL.

Tahmin etmeme izin ver, eth0 İnternet'e bakan arayüzüdür. Bunu yapmana gerek yok. Koymayın eth0 Köprüde

Sanırım yayının etkin olmasını, yani köprü oluşturmayı istiyorsunuz, böylece tüm VPN ana bilgisayarları birbirleriyle yayın yapabilir. Yapmadım ama tüm VPN'leri kullananlar bunu yapmadan yapabilmelidirler. eth0 Üzerinde olmak br0.

OpenVPN ile sunucu tarafında bir köprü olmasını istemenin nedeni, bir LAN ve VPN'i birleştirmek. Eğer bu bir VPS ise, arkasında bir LAN varmış gibi görünmüyor, böylece başka bir fiziksel arayüze köprü gerekli değil veya sizin için bir şey yapacak.


Öyle. tap0 istemcideki arabirim OpenVPN'de tanımlanan havuzdan atanmış bir IP’ye sahip server yapılandırması.
Tomasz

Güncelleme için cevabımı gör.
LawrenceC

Bu mantıklı, sadece coşkuyla biraz nasıl bir şey takip ediyordum. Senin fikrinle kaçmaya çalışacağım ve ne olacağını göreceğim. Bu yoldan tap0 gerçek bir adres verilmelidir 10.0.0.2/24 ve bazı yeni yollar görmeliyim. 10.0.0.0/24 ağ, doğru mu?
Tomasz

Ayarlamalıyım tap0 IP adresi manuel olarak açık server ama bunun dışında her şey harika çalışıyor. @Ultrasawblade!
Tomasz

Herhangi bir müşteriden diğer müşterilere herhangi bir köprü kullanmadan erişmeyi başardınız mı? Sizinle aynı durumla karşı karşıyayım, ancak hepsinin OpenVPN havuzundan IP almasına rağmen, diğer müşterilerden hiçbir müşteriye ping gönderemiyorum. Herhangi bir yardım için gerçekten minnettarım.
Mohammed Noureldin

1

OpenVPN'i seviyorum ve xUbuntu, öğrenme eğrisi ile ilk kez başlamanın bir PAIN olduğunu ve hepsi burada yardımcı olabilecek birkaç şey ...

OpenVPN, sunucunuzun şebekesiyle aynı olan ve farklı bir aralık kullanmaya zorlamadığınız IP'ler verebilir. Yaptığım tek şey yönlendiricilerime DHCP gelişmiş ayarlarına girmek ve yönlendiricime 192.168.1.200 - 192.168.1.250 yayınlamamasını söyledi.

Daha sonra OpenVPN sunucumu, atamalar için kullanılacak IP havuzu olarak 192.168.1.200 - 192.168.1.250 kenara bırakacak şekilde ayarladım.

Bu, çılgın rota kurulumlarına duyulan ihtiyacı en aza indirir ve bazen net haberleşmelerde sınırlı kalır (eğer bir müşteride rota ayarlamayı unutursanız, bir VPN istemcisi tarafından görülemeyebilir), ancak Yönlendiricinizin kullandığı IP'leri kullanmak aynı şeyi içeriyor ağ yolları ve alt ağ].

İşte benim /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
# auto eth0
# iface eth0 inet dhcp
#
# The loopback network interface
auto lo
iface lo inet loopback

 auto br1
  iface br1 inet static
  bridge_ports eth0
  address 192.168.1.62
  netmask 255.255.255.0
  gateway 192.168.1.1
  dns-nameservers 208.67.222.222 192.168.1.1
  dns-search home
  dns-domain home

 auto eth0
 iface eth0 inet dhcp

DNS Arama Seçeneği güzeldi, çünkü yönlendiricimdeki etki alanı olarak ev belirledim ve şimdi bir * nix istemcisinden ping router.home sayfasına gidersem, bunun tam bir Nitelikli DNS girişi olduğu yanıtını veriyor. İşlerin çalışabilmesi için bu gerekli değildir.

Ayrıca bunu br0 veya br1 olarak adlandırmanızın bir önemi olmadığını unutmayın. Bir şeyler üzerinde çalışırken bir şeyler ayarlarken ve br0'dan br1'e taşırken sorun yaşadım, bir kez tam olarak çalıştığımda br1 üzerinde çalışıyordum ve başarı ile uğraşmak istemedim :-)

İşte benim server config [Sunucu altımın IP'sini kesin olarak kaldırdım, sizinki neyse) ve tüm notları bırakıp her şeyi birisine yardım etmesini sağladım:

#################################################
# Sample OpenVPN 2.0 config file for            #
# multi-client server.                          #
#                                               #
# This file is for the server side              #
# of a many-clients <-> one-server              #
# OpenVPN configuration.                        #
#                                               #
# OpenVPN also supports                         #
# single-machine <-> single-machine             #
# configurations (See the Examples page         #
# on the web site for more info).               #
#                                               #
# This config should work on Windows            #
# or Linux/BSD systems.  Remember on            #
# Windows to quote pathnames and use            #
# double backslashes, e.g.:                     #
# "C:\\Program Files\\OpenVPN\\config\\foo.key" #
#                                               #
# Comments are preceded with '#' or ';'         #
#################################################

# Which local IP address should OpenVPN
# listen on? (optional)
local 192.168.1.xx

# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one.  You will need to
# open up this port on your firewall.
port 123

# TCP or UDP server?
;proto tcp
proto udp

# "dev tun" will create a routed IP tunnel,
# "dev tap" will create an ethernet tunnel.
# Use "dev tap0" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use "dev-node" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
dev tap0
;dev tun

# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one.  On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap

# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key).  Each client
# and the server must have their own cert and
# key file.  The server and all clients will
# use the same ca file.
#
# See the "easy-rsa" directory for a series
# of scripts for generating RSA certificates
# and private keys.  Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see "pkcs12" directive in man page).
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret

# Diffie hellman parameters.
# Generate your own with:
#   openssl dhparam -out dh1024.pem 1024
# Substitute 2048 for 1024 if you are using
# 2048 bit keys. 
dh dh2048.pem

# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
;server 10.8.0.0 255.255.255.0

# Maintain a record of client <-> virtual IP address
# associations in this file.  If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist ipp.txt

# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface.  Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume 10.8.0.4/255.255.255.0.  Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients.  Leave this line commented
# out unless you are ethernet bridging.
server-bridge 192.168.1.xx 255.255.255.0 192.168.1.200 192.168.1.254

# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses.  You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge

# Push routes to the client to allow it
# to reach other private subnets behind
# the server.  Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (10.8.0.0/255.255.255.0)
# back to the OpenVPN server.
push \u201croute 192.168.1.1 255.255.255.0\u2033
;push "route 192.168.20.0 255.255.255.0"

# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory "ccd" for client-specific
# configuration files (see man page for more info).

# EXAMPLE: Suppose the client
# having the certificate common name "Thelonious"
# also has a small subnet behind his connecting
# machine, such as 192.168.40.128/255.255.255.248.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
# Then create a file ccd/Thelonious with this line:
#   iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN.  This example will only work
# if you are routing, not bridging, i.e. you are
# using "dev tun" and "server" directives.

# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
#   ifconfig-push 10.9.0.1 10.9.0.2

# Suppose that you want to enable different
# firewall access policies for different groups
# of clients.  There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
#     group, and firewall the TUN/TAP interface
#     for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
#     modify the firewall in response to access
#     from different clients.  See man
#     page for more info on learn-address script.
;learn-address ./script

# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
;push "redirect-gateway def1 bypass-dhcp"

# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# http://openvpn.net/faq.html#dhcpcaveats
# The addresses below refer to the public
# DNS servers provided by opendns.com.
push "dhcp-option DNS 192.168.1.1"
push "dhcp-option DNS 208.67.222.222"

# Uncomment this directive to allow different
# clients to be able to "see" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
client-to-client

# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names.  This is recommended
# only for testing purposes.  For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE "COMMON NAME",
# UNCOMMENT THIS LINE OUT.
duplicate-cn

# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120

# For extra security beyond that provided
# by SSL/TLS, create an "HMAC firewall"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
#   openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
tls-auth ta.key 0 # This file is secret

# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
cipher BF-CBC        # Blowfish (default)
;cipher AES-128-CBC   # AES
;cipher DES-EDE3-CBC  # Triple-DES

# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
comp-lzo

# The maximum number of concurrently connected
# clients we want to allow.
max-clients 30

# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
user nobody
group nogroup

# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun

# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status openvpn-status.log

# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the "\Program Files\OpenVPN\log" directory).
# Use log or log-append to override this default.
# "log" will truncate the log file on OpenVPN startup,
# while "log-append" will append to it.  Use one
# or the other (but not both).
log         openvpn.log
;log-append  openvpn.log

# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 5

# Silence repeating messages.  At most 20
# sequential messages of the same message
# category will be output to the log.
mute 20

## Bridge Scripts
up "/etc/openvpn/up.sh br1 tap0 1500"
down "/etc/openvpn/down.sh br1 tap0"
script-security 3

İşte bir Windows 7 pro istemcisi ile kullandığım örnek çalışan bir istemci yapılandırması [Sunucumun uzak IP ve bağlantı noktasını tekrar sterilize ettim [veya burada DynDNS gibi bir DNS kullanabilirsiniz. Burada statik bir IP'niz yoksa iyi çalışıyor] Anahtar dosyalarımın adları da:

# Specify that this is a client
client

# Bridge device setting
dev tap

# Host name and port for the server (default port is 1194)
# note: replace with the correct values your server set up
remote 111.222.333.444 123

# Client does not need to bind to a specific local port
nobind

# Keep trying to resolve the host name of OpenVPN server.
## The windows GUI seems to dislike the following rule. 
##You may need to comment it out.
resolv-retry infinite

# Preserve state across restarts
persist-key
persist-tun

# SSL/TLS parameters - files created previously
ca ca.crt
cert client.crt
key client.key

# Since we specified the tls-auth for server, we need it for the client
# note: 0 = server, 1 = client
tls-auth ta.key 1

# Specify same cipher as server
cipher BF-CBC

# Use compression
comp-lzo

# Log verbosity (to help if there are problems)
verb 3

OpenVPN Ayarları adlı bir Android istemcisini de kullanabildiğimi söyleyebilirim [HİÇBİR CİHAZA İHTİYACINIZ VARLIKLI KÖPRÜ KURULUŞLARA GERÇEKLEŞTİREMEBİLİRSİNİZ ve Play Store'da bulunan OpenVPN Ayarlarını KURMADAN] Bir OSX istemcisi ve herkes kullanmak sonuçlardan çok memnundur. Sunucuyu tanıtmak için alt ağ yayınlarını kullanan Plex Media Server adında bir SWEET Media Server kullandığım için köprülü bir kuruluma ihtiyacım vardı ve eğer yayın alamıyorsanız bir müşteriyi kullanamazsınız [onlar da uzaktan hizmete sahipler. bir güvenlik somunu ve güvenli şifreli bağlantı servisini kullanmak yerine her şeyi kendim yönetmeyi tercih ederim: -.

Tüm bu yardımcı olur umarım :-D

Tüm ayarları çivilemek ve evreni mutlu etmek benim için çok zaman ve çaba harcadı, ama sonuçta buna değdi.

Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.