Page 1 of 1

How to add new config?

Posted: Fri Aug 05, 2011 10:03 am
by shinjikenny
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?

Re: How to add new config?

Posted: Fri Aug 05, 2011 2:06 pm
by Mimiko
Usualy the config file goes to /etc/openvpn
And of course you have to allow incomming connection to port 53 using iptables.

Re: How to add new config?

Posted: Fri Aug 05, 2011 3:33 pm
by shinjikenny
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

Re: How to add new config?

Posted: Fri Aug 05, 2011 3:52 pm
by Mimiko

Code: Select all

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

Re: How to add new config?

Posted: Sun Aug 07, 2011 9:57 am
by shinjikenny
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.

Re: How to add new config?

Posted: Sun Aug 07, 2011 12:25 pm
by Mimiko

Code: Select all

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