Solved

MySQL through ipsec tunnel

Posted on 2014-03-25
11
729 Views
Last Modified: 2014-04-13
I have two Red Hat Enterprise Linux 6 systems that are both on the same network:

HOST1 - Snort Sensor - 192.168.1.5
HOST2 - MySQL Database Server - 192.168.1.10

I need to make the Snort sensor write to the database via an ipsec tunnel.  I have the tunnel created using openswan using these instructions: http://www.putorius.net/2012/08/creating-end-to-end-ipsec-tunnel.html

Now I am wondering how do I force all MySQL traffic through the tunnel?  Any help would be appreciated.
0
Comment
Question by:savone
  • 6
  • 5
11 Comments
 
LVL 78

Expert Comment

by:arnold
ID: 39955033
You would use the are the IPs referenced on the 192.168.1.x the IP used in the IPSec tunnel or both locations use the same LAN segment?
Snort IPA for IPSec
Mysql DB server IPB for IPSec.

In your DB connection setting on the snort box you will use IPB and not the 192.168.1.10 IP.

You however have to make sure when granting the snort user reference IPA as the host from which that user will be connecting.
0
 
LVL 23

Author Comment

by:savone
ID: 39957817
So the IP addresses in the conf files should not be their real IP addresses, but rather a new network I made up?
0
 
LVL 78

Expert Comment

by:arnold
ID: 39957861
Are the two systems on the same segment and are accessible without a VPN?

If the two systems are at different locations that are using the same IP segments, IP overlay as part of the IPSec policy will be required.
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 23

Author Comment

by:savone
ID: 39957989
No the systems are on the same network segment and CAN communicate without a VPN.
0
 
LVL 78

Expert Comment

by:arnold
ID: 39958276
Then what is the purpose for the VPN?

Are you merely looking to encrypt the connection?

Mysql 5.1 and newer have the features to encrypt connections.
http://dev.mysql.com/doc/refman/5.1/en/ssl-connections.html
0
 
LVL 23

Author Comment

by:savone
ID: 39958517
Yes, I need to separate the traffic and they (management) want me to do it with ipsec tunnels.
0
 
LVL 78

Expert Comment

by:arnold
ID: 39959000
The IPs in the VPN configuration will the current IPs of each /32 defining only IP1 to IP2 traffic to match the VPN pattern and only this traffic will flow through the VPN.  

If the concern deals with observance of data, using SSL encryption of the mysql connection might be an alternative.

The only adjustment to the instructions you would replace 10.0.0.1 with 192.168.1.4
And 10.0.0.40 with 192.168.1.15.
0
 
LVL 23

Author Comment

by:savone
ID: 39959109
@arnold, why should I use 192.168.1.4 and 192.168.1.15?  Those are not the IP addresses of my machines.

Also, I have it set up as you are suggestion, but MySQL traffic is still using the default route and going around the ipsec tunnel.
0
 
LVL 78

Expert Comment

by:arnold
ID: 39959329
Oops, I checked which IPs to use prior to starting to write the response,
you would use the 192.168.1.5 and the 192.168.1.10

Since you want your snort box to access the mysql server, you should configure the openswan such that the client on the snort box initiate the connection.
0
 
LVL 23

Author Comment

by:savone
ID: 39960698
@arnold, we are back to square one.  The tunnel is up, but the MySQL data is still being send over the regular network and not the ipsec tunnel.
0
 
LVL 78

Accepted Solution

by:
arnold earned 500 total points
ID: 39960711
Check the IP xfrm policy to see whether it has the definition to route traffic between the two hosts via the tunnel.

During your configuration you might have missed the step that determines whether the data should enter the IPSec tunnel or not.

See the guide and double check every referenced configuration/setting.
0

Featured Post

Surfing Is Meant To Be Done Outdoors

Featuring its rugged IP67 compliant exterior and delivering broad, fast, and reliable Wi-Fi coverage, the AP322 is the ideal solution for the outdoors. Manage this AP with either a Firebox as a gateway controller, or with the Wi-Fi Cloud for an expanded set of management features

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SonarQube on Linux vs Windows 3 79
bash file 10 68
RHEL 6.7 Gnome Desktop on VMware 6 VM 9 113
CentOs root password/fsck issue 7 34
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question