Results 1 to 2 of 2

Thread: Install openvpn in bridge mode

  1. #1
    Join Date
    Nov 2009
    Posts
    583

    Install openvpn in bridge mode

    Hello,
    Vpn openvpn service is very safe, super stable, and lightweight package (quality drives widely PPTP), relatively simple to implement, although I struggled to understand its simplicity, and full of useful features. If you need to read them in details then you can visit their official site. Apart from the obvious cases where you need to securely connect remote sites, it is a good tool to route data to a gateway and work-Fi, all with a good safety. In addition, the Windows version also works well and is configured somewhat near the same way (and yes, sometimes you manage Windows clients too, it must memory).

    Phase 1: prerequisites, necessary preinstallation packages
    Beware
    The end of install, there are changes to check:
    * create a user / group openvpn before running the script.
    * Consider changing the listening interface eth0 br0 in the files in eg routing, configuration of various servers (Squid, Samba, etc.) AND especially in / etc / default / dhcp
    openvpn sometime crashes with kernel 2.4, it is best to use 2.6.
    Moreover, what I did not test for various reasons, it is advisable to use a kernel which is applied the patch grsecurity.
    kernel must contain the following active option
    Device Driver
    -> Networking support
    -> Networking Options
    ---> Universal TUN / TAP device driver support
    ---> 802.1d Ethernet Bridging
    Facilities provided on the debian server:
    Code:
    apt-get install openvpn bridge-utils openssl-dev libssl-dev liblzo1 liblzo
    the client debian:
    Code:
    apt-get install openvpn liblzo1
    All these packages can be made finer source and recompiled of course in the case of a dedicated server access.

    Phase 2: implementation of PKI
    For authentication We will implement a PKI (Public Key Infrastructure "= Public Key Infrastructure), and identify one to one client access server, using play scripts" easy-rsa "provided by the package openvpn . Start copy in a safe corner, the directory / usr / share / doc / openvpn / examples / easy-rsa.
    Code:
     Cp-R / usr / share / doc / openvpn / examples / easy-rsa /.
    Become root, and secure directory:
    Code:
    # Chown-R root.root easy-rsa 
    # chmod-R-0700 easy rsa
    Take to the directory.
    The first step is to change variables common to the generation of different keys. These variables are adjusted in the file vars. Here's an example:
    Code:
    export D = `pwd` 
    export KEY_CONFIG = $ D / openssl.cnf 
    export KEY_DIR = $ D / keys 
    export KEY_SIZE = 1024 
    = U.S. export KEY_COUNTRY 
    export KEY_PROVINCE = Country 
    Export KEY_CITY = Anytown 
    export KEY_ORG = "My Company" 
    export KEY_EMAIL = dummy @ test.com "
    From now on, whenever you come back to generate a key or key operation, think of "sourcing" before this file to update your environment:
    Here is what you have to do
    Code:
    #. . / Vars
    Next:
    Code:
    # Mkdir keys 
    # touch keys / index.txt 
    # echo 01> keys / serial 
    # 0700 chmod-R keys
    Preparation key to the server:
    Code:
    #. / Build-dh 
    #. / build-ca 
    #. / build-key-server server
    and a client:
    Code:
    . / Build-key client
    Notes:
    - Remember to use the CN ( Common Name) unique for each participant (VPN server and each client), otherwise your server will not work! Also put an ON (Organization Name) Common server and clients.
    - Do not use fqdn to designate your server and clients, openvpn does not like keys with a long file name with an at sign it. I was not able to know why, but some names fqdn pass, others not.
    - Do not transfer your keys in an insecure channel. The ideal is to store the keys directory on a USB key and nothing on the machine but can also use the user openvpn in scp for transfer card (because the user root must be reasonable if you are disabled for ssh).

    Configuration server
    Bridged or not, uses a mechanism called openvpn Tun / Tap, which is a kind of "virtual cable" between the client and server, which is expressed on both sides by adding an interface (in routed Tunxi, tapX in bridged). The routed mode is easily understandable, namely that it must be configured, once the "cable" plugged in, the possible routing tables on the client and the server is considered so as routers. This setup is fairly simple but requires a network to use "except" to the input interface of the server and clients, an increase of hop distance between the two lan connected, and does not transfer any other protocols as known iptables router (no ipx, or - yuck - netbios, for example). For info, just install the openvpn server config example, change a few values, and configure some routing. As I indicated in the title, this tutorial provides a bridge mode configuration ("Bridged"), as opposed to routed mode (routed). Bridged or not, uses a mechanism called openvpn Tun / Tap, which is a kind of "virtual cable" between the client and server, which is expressed on both sides by adding an interface (in routed Tunxi, tapX in bridged).
    The routed mode is easily understandable, namely that it must be configured, once the "cable" plugged in, the possible routing tables on the client and the server is considered so as routers. This setup is fairly simple but requires a network to use "except" to the input interface of the server and clients, an increase of hop distance between the two lan connected, and does not transfer any other protocols as known iptables router (no ipx, or - yuck - netbios, for example). For info, just install the openvpn server config example, change a few values, and configure some routing.
    Code:
    port 5555 
    proto udp 
    dev tap0 
    
    ca ca.crt 
    cert serveur.crt 
    key server.key 
    dh dh1024.pem 
    
    ifconfig-pool-persist ipp.txt 
    
    server-bridge 192.168.0.1 255.255.255.0 192.168.0.151 192.168.0.250 
    
    keepalive 10 120 
    comp- lzo 
    
    user openvpn 
    group openvpn 
    
    persist-key 
    persist-tun 
    status openvpn-status.log 
    a verbport 5555 
    proto udp 
    dev tap0 
    
    ca ca.crt 
    cert serveur.crt 
    key server.key 
    dh dh1024.pem 
    
    ifconfig-pool-persist ipp.txt 
    
    server-bridge 192.168.0.1 255.255.255.0 192.168.0.151 192.168.0.250 
    
    keepalive 10 120 
    comp- lzo 
    
    user openvpn 
    group openvpn 
    
    persist-key 
    persist-tun 
    status openvpn-status.log 
    a verb
    Config on the client:
    On the client, a config file is enough:
    * / etc / openvpn / client.conf
    Code:
    client 
    dev tap0 
    proto udp 
    remote adresse.du.serveur 5555 
    resolv-retry infinite 
    nobind 
    user openvpn 
    group openvpn 
    persist, key 
    persist-tun 
    ca ca.crt 
    cert client.crt 
    client.key key 
    comp-lzo 
    verb 1
    Last edited by SoftWore; 29-04-2010 at 03:54 PM.

  2. #2
    Join Date
    Apr 2011
    Posts
    56

    Re: Install openvpn in bridge mode

    I have produced a PPTP VPN connection on the way to windows 7 PC. The connection is completed in the course of a standard Netgear ADSL router/switch with port forwarding in the direction of the server (192.168.0.2). (I have updated the router to most up-to-date BIOS.) I am able to authenticate and connect through the server all time, however only observe the shared drive every other time I connect. If I ping 192.168.0.1 (the router) it is only visible every other time I connect as well. what you think about this?

Similar Threads

  1. How to use WLan in Bridge mode with AR800v v3.0 modem?
    By CheeCha in forum India BroadBand
    Replies: 7
    Last Post: 05-03-2012, 07:55 PM
  2. Does Cisco DDR2200 support bridge mode
    By Vj@y.Deenanath in forum Networking & Security
    Replies: 5
    Last Post: 31-12-2011, 05:27 AM
  3. Need help for Bridge mode setup in Netgear DM111P
    By AlpAnA$ in forum Networking & Security
    Replies: 3
    Last Post: 18-09-2011, 11:59 PM
  4. What is bridge mode ?
    By roshan45 in forum Networking & Security
    Replies: 3
    Last Post: 25-11-2009, 06:38 PM
  5. How to set up a router in bridge mode
    By Bhadrak in forum Networking & Security
    Replies: 3
    Last Post: 10-08-2009, 10:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,251,655.97831 seconds with 17 queries