LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-24-2019, 08:23 AM   #1
runeas
LQ Newbie
 
Registered: May 2018
Distribution: Raspbian
Posts: 2

Rep: Reputation: Disabled
Configuring iptables on Raspberry pi openvpn-server


First I have to tell that I am a newbie, and have quite little linux-knowlgedge, as this is more a hobby than an occupational hobby. So apologies for asking a simple question.

I am building a home-surveillance system with 2 cameras using two Raspberry pis. I have port-forwarded my router to port 1194. On the first Raspberry (RPI1) I have installed Raspbian Stretch, and an Openvpn-server so that I can connect from the outside. I have also installed “Motion” on the same RPI. On the other RPI (RPI2) I have installed “Motioneye OS”. This system works great, both regarding connecting from the outside via Openvpn and VNC and from “the inside” with ssh, as it is, but I am wondering whether I need to protect my Raspberrys a bit more by making a configuration of Iptables on RPI1.

So I have tried the following configuration:

iptables -A INPUT -p udp --dport 1194 -j ACCEPT (openvpn)
iptables -A INPUT -p tcp --dport 22 -j ACCEPT (ssh)
iptables -A INPUT -p tcp --dport 5900 -j ACCEPT (vnc)
iptables -A INPUT -j REJECT (Block everything else)


This doesn´t work, Iptables blocks me from using both openvpn, vnc, and ssh. Can anyone please help me with the configuration, or is it unnesscesary to use iptables as long as my RPIs are protected behind my router?

Most thankfull for any help!
 
Old 06-25-2019, 11:14 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

I recommend you use one of the packages that provides a user friendly front end to iptables. A couple of suggestions are arno-iptables-firewall or ufw, or the gui front end to ufw, gufw.

Evo2.
 
1 members found this post helpful.
Old 06-27-2019, 03:27 AM   #3
runeas
LQ Newbie
 
Registered: May 2018
Distribution: Raspbian
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thank you for your reply!

I will try what you suggest!



Quote:
Originally Posted by evo2 View Post
Hi,

I recommend you use one of the packages that provides a user friendly front end to iptables. A couple of suggestions are arno-iptables-firewall or ufw, or the gui front end to ufw, gufw.

Evo2.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Directing OpenVPN client's traffic through the OpenVPN server mohtasham1983 Linux - Networking 1 01-17-2012 06:44 PM
configuring openvpn with iptables rules (internet connection freezes when tun0 is up) BlackHawk Linux - Networking 11 06-22-2011 12:36 AM
OpenVPN client has not default gateway when connect to OpenVPN server sailershen Linux - Security 3 03-04-2010 02:20 AM
How does OpenVPN Linux server issues IP and netmask to OpenVPN clients on Windows XP pssompura Linux - Networking 0 12-24-2009 02:42 AM
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration