Tuesday, August 14, 2018

OpenVPN configuration for server and multiple clients

This is a simple post showing a basic configuration for setting up OpenVPN server accepting multiple clients with TLS.

First of all generate self-signed server and client private key and certificates, and dh params. Make sure to write the Organization Name AND Common Name (CN) when asked, otherwise openvpn will fail to verify the certificates.

openssl req -newkey rsa:2048 -nodes -keyout serverkey.pem -x509 -days 365000 -out servercert.pem
openssl req -newkey rsa:2048 -nodes -keyout clientkey.pem -out client.csr
openssl x509 -req -days 365000 -in client.csr -CA servercert.pem -CAkey serverkey.pem -set_serial 01 -out clientcert.pem
openssl dhparam -outform PEM -out dh.pem 1024


Server configuration:

dev tun
mode server
tls-server
server 10.8.0.0 255.255.255.0
ca servercert.pem
cert servercert.pem
key serverkey.pem
dh dh.pem
duplicate-cn
topology subnet
keepalive 10 60
ping-timer-rem
persist-tun
persist-key

If you plan to use the server as gateway like configured below, don't forget to enable IP forwarding and masquerading:

sysctl net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j MASQUERADE

Client configuration:

client
redirect-gateway
tls-client
key clientkey.pem
cert clientcert.pem
ca servercert.pem
keepalive 10 60
dev tun


Have fun, tune as needed.

59 comments:

Robotic Process Automation Tutorial said...

Thanks for such a great article here. I was searching for something like this for quite a long time and at last I’ve found it on your blog. It was definitely interesting for me to read about their market situation nowadays. Well written article Thank You for Sharing with Uspmp training in chennai | pmp training institute in chennai | pmp training centers in chennai| pmp training in velachery | pmp training near me | pmp training courses online

Anonymous said...

Hey, Wow all the posts are very informative for the people who visit this site. Good work! We also have a Website. Please feel free to visit our site. Thank you for sharing. Well written article Thank You for Sharing with Us pmp training institute in chennai | pmp training in chennai project management training certification | project management training in chennai | project management certification online |

jvimala said...

You are doing a great job. I would like to appreciate your work for good accuracy
Regards,
best selenium training institute in chennai

institute of marketing said...

Nice post.Thanks for sharing such a amazing post with us and keep blogging
Digital Marketing course in Bangalore fees

DedicatedHosting4u said...

It's a very well endowed, advantageous for everyone ... Thank you for providing us such useful knowledge. Currently, I am a daily reader of your blogs. Thank you most for the wonderful assortment, keep writing.

DedicatedHosting4u.com

Unknown said...

thanks for sharing this type article continue blogging.
i am sharing news article international,national and local news

Asad said...

I'm so glad i always read and check you updates of blog posts. inspiring as always! :) click here

auto slotxo said...

I like the article. Thank you. It has increased knowledge. I also made my articles. Try to come see
สล็อตjoker

Sagaminghahaha said...

You can write an article very much. Thank you for making a great article to read.
Sa gaming สมัคร

Ismail said...

Great article..Thanks for sharing...
Interior Design Sketches in Bangalore

Ismail said...

Thanks for sharing this information with us...
Unani Treatment in Bangalore

Ismail said...

Nice post!! Thanks for sharing...
Digital Marketing in Bangalore

Elegant IT Services said...

Thanks for sharing the Useful Information...
Best IT and Non-IT Training Institute in Bangalore

mamta said...

Very Nice Blog, You are spreading very good information among us… Yes Web Hosting plays very important role in business world. And it is important to have the best hosting services.
Germany VPS Hosting

ีuplay365 said...

I think this is one of the most significant information for me.
And i’m glad reading your article.
But should remark on some general things, the web site style is perfect,
the articles is really great : D. Good job…
vscr888

emblix solutions said...

Thanks for sharing this information. Today, Emblix as one of the best and top most service-oriented Digital Marketing Agency in Hyderabad and India , Which provides high-quality result-oriented Digital Services ranging from SEO to Web Design, Social Media Marketing and more, to a broad spectrum of clients from diverse industry segments. Through a well-oiled combination of Quality Solutions, Transparent Pricing, helping brands connect with customers, Flexible Delivery & Contract Model with a firm commitment to deliver on time and to budget, Emblix has successfully built a strong relationship with clients based on mutual trust and respect. Emblix solutions-digital marketing company

Anonymous said...

Thanks for sharing
Click Now
Click Now
Click Now
Click Now
Click Now
Click Now
Click Now
for more information

Anonymous said...

thanks for sharing
click
click
click
click
click
click
click
click
click
click
click
click
click
click
click
click
click
click
click
click
click
for more info

manjot singh said...

click
click
click
click
click
click
click
click
click
click
click
click

manjot singh said...

click
click
click
click
click
click
click
click
click
click
click
click
click

Pavan said...


Hi.thanks for your reach-out efforts. This is a great blog. Keep sharing important information like this I really appreciate it. And Web Hosting plays a very important role in the business world. And it is important to have the best hosting services. Buy the bestUSA VPS hosting service for your website.

Kartik Rajput said...
This comment has been removed by the author.
Anonymous said...

Very informative and attractive..
You explain very well in this article i was searching this for this kind of information...
If you want to increase your website loading smoothness! We have best USA VPS service.

Pandit Manjunath said...

thank you for sharing Informative blog
Best Astrologer In Bangalore

Emblix Academy said...

Emblix Academy – Digital marketing institute in KPHB, we address all major and minor aspects required for any student’s advancement in digital marketing. Clutch USA named our Digital Marketing Institute the best SEO firm. for more info visit here : https://emblixacademy.com/

python course in banglore said...

IntelliMindz is the best IT Training in Bangalore with placement, offering 200 and more software courses with 100% Placement Assistance.

Python Course in Bangalore
React Course In Bangalore
Automation Training In Bangalore
Blue Prism Courseourse In Bangalore
RPA Course In Bangalore
UI Path Training In Bangalore
Clinical SAS Training In Bangalore
Oracle DBA Training In Bangalore
IOS Training In Bangalore
<a href="https://intellimindz.com/tally-course-in-bangalore/>Tally Course In Bangalore</a>

Arulraj said...

The concept of thoughts about computer technology is very nice,Thanks for sharing & is very useful article.
For sofa repair work contact thesofastore gives best
Sofa Refurbishing in Yelachenahalli,Bangalore

shri chakram astro centre said...

Nice pick. it's very Useful Article.

SRICHAKRAM ASTROLOGY.Best Astrologer In Hubli

Pandith13 said...

Very good article, Thank you

SRIKRISHANA ASTROLOGY.Best Astrologer In Bagalkot

Unknown said...

Emblix Academy – Digital marketing institute in KPHB, we address all major and minor aspects required for any student’s advancement in digital marketing. Clutch USA named our Digital Marketing Institute the best SEO firm.

The future of digital marketing is promising and full of possibilities.
As a result, skilled digital marketers who can keep up with the rising demand are in high order.

In the Emblix Academy Digital marketing institute in KPHB, you will learn about all the major and minor modules of digital marketing, from Search engine marketing to Social Media Marketing and almost all Tools used for Digital Marketing.

One stop place for all Digital Marketing courses! Emblix Academy is a Team of dedicated Professionals with 12years of experience in various Digital Platforms. We assure to provide the best Digital Marketing courses to enhance your Career.

Certifications
• Search Advertising
• Display Advertising
• Analytics Certification
• Hubspot Certification
• Bing Certification
• Twitter Certification
• Facebook Certification

Website: https://emblixacademy.com/

Ufa88kh said...

Thank you so much for the wonderful information. I appreciate it very much.
ufa88cambodia wordpress
ufa88kh.blogspot
ufa88cambodia youtube
SA GAMING

Saidarpan Astrology said...

Thank You For Sharing This Blog.
For Best Astrologer in Bangalore

Ganapthiastro said...

Woww..!!Great article. Keep it up!
For Astrology Solution
Astrologer in Bangalore

abhiramindia said...

Very good article, Thank you
ABHIRAM ASTROLOGY CENTER.Best Astrologer In whitefield

DurgaAnugarha said...

it was great information and very useful
DURGAANUGARHA ASTROLOGY.Best Astrologer In marathahalli

Nurtureify said...

be one of the most embarrassing messes one may face. That flaky thing on your hair may definitely make an impression of you as someone unhygienic or dirty. Home Remedies For Treating Dandruff = === Dandruff could be one of the most embarrassing messes one may face. That flaky thing on your hair may definitely make an impression of you as someone unhygienic or dirty. be one of the most embarrassing messes one may face. That flaky thing on your hair may definitely make an impression of you as someone unhygienic or dirty. daily update on nurtureify.com

Nurtureify said...

Digital marketing trainer in Faridabad We provide best training in digital marketing, social media, google adwords, seo and many other modules in digital marketing Digital marketing trainer in Faridabad We provide best training in digital marketing, social nedia, google adwords, seo and many other modules in digital marketing

Astrologer Vidya Shankar said...

thank you for sharing Informative blog
Best Astrologer In Mumbai

Sudharshan Bhat guruji said...

Good Article you know your article it's useful me. it's really good and helping your article and yes thanks for sharing information
For Astrological solutions contact Shri Durga astro center,They gives
Best Astrologer In Udupi

Sudharshan Bhat guruji said...

Nice blog with good content,thanks for sharing.
For Astrological service contact Shri Durga astro center,They gives
Vashikaran Astrologer in Shivamogga

Ufa88kh said...

Very nice and lovely work :) I like your good ideas, thanks for the inspiration!
wordpress
ufa88kh.blogspot
youtube
ចាក់បាល់

Service Providers said...

Thanks for posting this blog! keep posting!
For Washing Machine Repair in Bangalore.Contact us.

MS Groups Resorts said...

Thanks for the useful post.
Visit Madikeri Resorts.

Unknown said...


Emblix Academy – Digital marketing institute in KPHB, we address all major and minor aspects required for any student’s advancement in digital marketing. Clutch USA named our Digital Marketing Institute the best SEO firm.

The future of digital marketing is promising and full of possibilities.

As a result, skilled digital marketers who can keep up with the rising demand are in high order.
In the Emblix Academy Digital marketing institute in KPHB, you will learn about all the major and minor modules of digital marketing, from Search engine marketing to Social Media Marketing and almost all Tools used for Digital Marketing.
One stop place for all Digital Marketing courses! Emblix Academy is a Team of dedicated Professionals with 12years of experience in various Digital Platforms. We assure to provide the best Digital Marketing courses to enhance your Career.
Certifications

• Search Advertising
• Display Advertising
• Analytics Certification
• Hubspot Certification
• Bing Certification
• Twitter Certification
• Facebook Certification

https://emblixacademy.com/

Sherman Souto said...

Thank you for providing this blog really appreciate the efforts you have taken into curating this article if you want you can check out data science course in bangalore they have a lot to offer with regards to data science in terms of training and live projects.

Akshat said...

Great very helpful blog. Thanks For Sharing Such A Wonderful Blog. I will definitely go ahead and take advantage of this. Your Blog Is Very Informative. Again Thanks For Sharing This Blogs With Us. For more learning go through Skillslash.
For Data Science Course Data Science Course In Bangalore

logesh said...

Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ibm full form in india |
ssb ka full form |
what is the full form of dp |
full form of brics |
gnm nursing full form |
full form of bce |
full form of php |
bhim full form |
nota full form in india |
apec full form

Unknown said...

ทางเข้า pg slot ให้บริการตลอด 24 ชั่วโมง เว็บไซต์สล็อตออนไลน์ที่ได้รับการการันตี​จากนักพนันว่าเป็นเว็บที่ดีที่สุด เล่นได้ทุกระบบ เว็บของเรานั้นไม่ได้มีให้คุณเล่นทดลองเล่น ทางเข้า pg slot

PSW550 said...

ทำกำไรได้เพลิตเพลิน พร้อมสนุกได้แล้วกับค่าย PG ค่ายเกมที่ให้คุณได้เล่นมากมาย ทั้งสล็อตออนไลน์ คาสิโนออนไลน์ อาเขต และยิงปลา มากถึง 200 เกม รูปแบบ 3มิติที่เร้าใจ มาในหลากหลายรูปแบบ เล่นได้เลย ไม่ต้องฝาก ไม่ต้องแชร์ PGฟรีเครดิต

slot said...

ทำกำไรได้ง่าย เล่นได้ทันทีกับค่ายเกมยักษ์ใหญ่อย่าง PGSLOT พร้อมให้คุณได้ทำการเล่นได้อย่างหลากหลาย PGเครดิตฟรี ด้วยอัตราการจ่างเงินรางวัลที่สูง เล่นได้ทันที ไม่ต้องผ่านเอเย่นต์ กับเว็บไซต์ PGSLOT-AUTO เล่นเกมได้คลอด 24 ชั่วโมง

newin said...

โบนัสพิเศษภายในเกมสล็อต โจรสลัดสุดมั้งคั่ง มีฟีเจอร์คูณเงินรางวัลสูงสุดมากถึง x10 เท่าของเงินรางวัล เกมสล็อตอัพเดทใหม่ล่าสุด จากทางค่าย MEGA SLOT mujlk,ki5g-hkmeg’bowfhmuj ทางเข้า mega https://www.megaslot.game/service/login/ แบบ 24 ชั่วโมง.

kaashivit said...

Interesting stuff to read and useful to improve knowledge. Keep posting.
eniac full form in computer
dvd full form
sit full form
pcc full form
iucn full form
full form of lcd
brics full form
tally erp full form
full form of ctbt
crpf full form

DigitalOperate said...

Thanks for such a great article here


Digital Operate | Digital Marketing Agency in Hyderbad, India

https://digitaloperate.com/

Learnbay said...

HI.
Great Article.
This Is Just An Awesome Blog That People Can Learn A Very Good Lesson About. It Is Very Informative And Explained In Detailed And Simple Words Which Is Easy To Understand.
I Have Come Across A Website That Is Informative And Helps Me To Get A Good Knowledge
Want to Learn Data Science Course in Hyderabad.
Visit my Profile for More Information
Data science course in Hyderabad .

Mona Mishra said...


Nice Content
Inovies

Phuwadon said...

มาสนุกกับเกมสล็อตแนวดิ่งวันนี้ ผู้ให้บริการเกมสล็อตออนไลน์ในปี 2022 เช่น PG168 ซึ่งเสนอเกมสล็อตมากกว่า 200 รายการ รวมถึงโหมดพิเศษพร้อมคุณสมบัติใหม่มากมายหรือสามารถ ทดลองเล่นสล็อต แมชชีน คลิกที่นี้ เป็นเดโม่ ลองเล่นดูก่อนใครได้แล้ววันนี้โดยไม่มีค่าใช้จ่ายใดๆทั้งสิ้นเล่นฟรีได้แบบเต็มพิกัด

hi said...

I need to thank you for this very good read and i have bookmarked to check out new things from your post. Thank you very much for sharing such a useful article and will definitely save and revisit your site.
best c online course
online oracle
c course
cheap website design in chennai
big data training online

เบทฟิก said...

เพื่อประหยัดระยะเวลาให้กับสมาชิกทุกท่านที่เข้ามาใช้บริการ pg slot ทดลองเล่น ไม่ให้สะดุดระหว่างการเล่น PG SLOT PG

Akash Yadav said...

Your thoughts about technology, in general, are nice and I liked this article because it's so helpful. If you're curious about what a Brazil Dedicated Server might do for you, there's a company that offers some of the best around.