How to add new config?

This forum is for all inquiries relating to the installation of OpenVPN from source and with binaries.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please visit (and READ) the OpenVPN HowTo http://openvpn.net/howto prior to asking any questions in here!
Post Reply
shinjikenny
OpenVPN User
Posts: 25
Joined: Fri Jul 29, 2011 5:32 am

How to add new config?

Post by shinjikenny » Fri Aug 05, 2011 10:03 am

How do I add a new config?
Do I just paste the *.conf file to /etc/openvpn then run the command

Code: Select all

#service openvpn restart
???
Or do I still need to edit the iptables everytime I add a new config??



I already have a working config that uses UDP port 1194. Then I decide to add a new config that uses different port. I just made a new config, same as the port 1194 config, I just change the port to 53. Then I typed the command

Code: Select all

#service openvpn restart
But the new config that uses port 53 doesn't work. Is there anything wrong with what I did?

User avatar
Mimiko
Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: How to add new config?

Post by Mimiko » Fri Aug 05, 2011 2:06 pm

Usualy the config file goes to /etc/openvpn
And of course you have to allow incomming connection to port 53 using iptables.

shinjikenny
OpenVPN User
Posts: 25
Joined: Fri Jul 29, 2011 5:32 am

Re: How to add new config?

Post by shinjikenny » Fri Aug 05, 2011 3:33 pm

This is the command I use in my iptables:

Code: Select all

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to 184.x.x.x

Should I enter that command again so I could use UDP port 53? The first UDP 1194 is working but the port 53 donesn't...

here's my current iptables:

Code: Select all

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
SNAT       all  --  10.8.0.0/24          anywhere            to:184.x.x.x

User avatar
Mimiko
Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: How to add new config?

Post by Mimiko » Fri Aug 05, 2011 3:52 pm

Code: Select all

iptables -A INPUT -p tcp,udp --dport 53 -j ACCEPT

shinjikenny
OpenVPN User
Posts: 25
Joined: Fri Jul 29, 2011 5:32 am

Re: How to add new config?

Post by shinjikenny » Sun Aug 07, 2011 9:57 am

Mimiko wrote:

Code: Select all

iptables -A INPUT -p tcp,udp --dport 53 -j ACCEPT

Code: Select all

[root@host ~]# iptables -A INPUT -p tcp,udp --dport 53 -j ACCEPT
iptables v1.3.5: unknown protocol `tcp,udp' specified
Try `iptables -h' or 'iptables --help' for more information.

User avatar
Mimiko
Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: How to add new config?

Post by Mimiko » Sun Aug 07, 2011 12:25 pm

Code: Select all

iptables -A INPUT -p tcp --dport 53 -j ACCEPT
iptables -A INPUT -p udp --dport 53 -j ACCEPT

Post Reply