In our deployment we have two servers. I want to connect it via host to host VPN: Host-To-Host VPN Using Openswan
On one server we have JMS broker on the second server we have JMS client and I want allow access to JMS broker only if it is pass via IPSec channel (JMS broker and client is only for the example).
Is it possible to check that packets pass via IPSec channel?
you can filter packets based on specific fields ipsec. For example, you can use the different modules offered by iptables with the -m option or --match:
http://linux.die.net/man/8/iptables, see Match extensions