ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Assigning Static IP on OpenVPN Linux Ubuntu 12.04

    IT Discussion
    vpn openvpn linux ubuntu ubuntu 12.04
    4
    8
    2.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      iahr
      last edited by scottalanmiller

      Hi Everyone,

      Is there anyone who can help me to assign static IP on OpenVPN using Ubuntu 12.04.

      Here's my config on my server.conf:
      port 1194
      proto udp
      dev tun
      ca ca.crt
      cert myserver.crt
      key myserver.key # This file should be kept secret
      dh dh1024.pem
      server 10.8.0.0 255.255.255.0
      ifconfig-pool-persist ipp.txt
      client-config-dir ccd
      push "redirect-gateway def1 bypass-dhcp"
      push "dhcp-option DNS 208.67.222.222"
      push "dhcp-option DNS 208.67.220.220"
      client-to-client
      keepalive 10 120
      comp-lzo
      max-clients 10
      persist-key
      persist-tun
      status openvpn-status.log
      verb 3
      mute 20

      And I created a ccd directory and config:
      mkdir /etc/openvpn/ccd
      touch /etc/openvpn/ccd/username1

      /etc/openvpn/ccd/username1:
      Code:
      ifconfig-push 10.8.0.9 10.8.0.10

      But did not getting the IP I assigned it gives the dhcp availabale IP.

      Hope someone can help me with this.

      Thanks in advance

      1 Reply Last reply Reply Quote 2
      • mlnewsM
        mlnews
        last edited by

        Pinging this one to get more eyeballs on it.

        JoyJ 1 Reply Last reply Reply Quote 0
        • JoyJ
          Joy @mlnews
          last edited by

          @mlnews said:

          Pinging this one to get more eyeballs on it.

          Thanks @mlnews

          1 Reply Last reply Reply Quote 0
          • dafyreD
            dafyre
            last edited by

            Have you restarted the OpenVPN service by any chance?

            JoyJ 1 Reply Last reply Reply Quote 1
            • JoyJ
              Joy @dafyre
              last edited by

              @dafyre said:

              Have you restarted the OpenVPN service by any chance?

              Yes it has restarted a lots of time.

              1 Reply Last reply Reply Quote 0
              • dafyreD
                dafyre
                last edited by

                Have you tried:

                ifconfig-push 10.8.0.10 10.8.0.9 
                

                ?

                1 Reply Last reply Reply Quote 1
                • I
                  iahr
                  last edited by

                  Hi dafyre thanks for the reply. Yes Joy and I tried that as well. We tried to change IP's based on IP Addressing schema below:

                  [ 1, 2] [ 5, 6] [ 9, 10] [ 13, 14] [ 17, 18]
                  [ 21, 22] [ 25, 26] [ 29, 30] [ 33, 34] [ 37, 38]
                  [ 41, 42] [ 45, 46] [ 49, 50] [ 53, 54] [ 57, 58]
                  [ 61, 62] [ 65, 66] [ 69, 70] [ 73, 74] [ 77, 78]
                  [ 81, 82] [ 85, 86] [ 89, 90] [ 93, 94] [ 97, 98]... and so on

                  but still no luck to get the static IP we assign. Still getting IP on DHCP.

                  Thanks.

                  1 Reply Last reply Reply Quote 0
                  • I
                    iahr
                    last edited by

                    I also tried to use the ccd with different segment, with config below:

                    server.conf
                    client-config-dir /etc/openvpn/ccd
                    route 10.8.2.0 255.255.255.0

                    /etc/openvpn/ccd/username1:
                    Code:
                    ifconfig-push 10.8.2.9 10.8.2.10

                    but still getting 10.8.0.x internal IP instead of 10.8.2.x.

                    Also put in IPtables:
                    iptables -A FORWARD -s 10.8.2.0/24 -j ACCEPT

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post