Openstack如何正确激活vpnaas日志?

如何解决Openstack如何正确激活vpnaas日志?

我们有一个带有openstack ansible的openstack集群构建,我们对此非常满意。实际上,我正在尝试设置VPN。我们已经激活了所有必需的东西,并在openstack和sonicwall之间成功进行了尝试。不幸的是,我们正在尝试与客户建立连接,我正在寻找一些日志,但似乎什么都没有记录。

我们正在使用Openstack Ussuri和Ubuntu 20.04

我们激活了Strongswan

一些配置文件下面:

控制器节点: /etc/neutron/neutron.conf

[DEFAULT]
# Disable stderr logging
use_stderr = false
debug = true
publish_errors = true
fatal_deprecations = False
use_journal = True
## Rpc all
executor_thread_pool_size = 64
rpc_response_timeout = 60
transport_url = hide
# Domain to use for building hostnames
dns_domain = openstacklocal
# Agent

[agent]
polling_interval = 5
report_interval = 60
root_helper = sudo /openstack/venvs/neutron-21.0.0/bin/neutron-rootwrap 
/etc/neutron/rootwrap.conf
root_helper_daemon = sudo /openstack/venvs/neutron-21.0.0/bin/neutron- 
rootwrap-daemon /etc/neutron/rootwrap.conf
# Messaging

[oslo_messaging_rabbit]
ssl = True
rpc_conn_pool_size = 30
# Notifications

[oslo_messaging_notifications]
topics = notifications
driver = messagingv2
transport_url = hide
# Concurrency (locking mechanisms)

[oslo_concurrency]
lock_path = /var/lock/neutron

/etc/neutron/l3_agent.ini:

[DEFAULT]
debug = True
# Drivers
interface_driver = linuxbridge
agent_mode = legacy
# Conventional failover
allow_automatic_l3agent_failover = True
# HA failover
ha_confs_path = /var/lib/neutron/ha_confs
ha_vrrp_advert_int = 2
ha_vrrp_auth_password = hide
ha_vrrp_auth_type = PASS
# Metadata
enable_metadata_proxy = True
# L3 plugins
# VPNaaS

[vpnagent]
vpn_device_driver = neutron_vpnaas.services.vpn.device_drivers.strongswan_ipsec.StrongSwanDriver

[AGENT]
extensions = vpnaas

/etc/neutron/neutron_vpnaas.conf:

[service_providers]
service_provider = VPN:strongswan:neutron_vpnaas.services.vpn.service_drivers.ipsec.IPsecVPNDriver:default

/etc/neutron/rootwrap.conf:

[DEFAULT]
# List of directories to load filter definitions from (separated by ',').
# These directories MUST all be only writeable by root !
# List of directories to search executables in,in case filters do not
# explicitely specify a full path (separated by ',')
# If not specified,defaults to system PATH environment variable.
# These directories MUST all be only writeable by root !
# Enable logging to syslog
# Default value is False
use_syslog = False
# Which syslog facility to use.
# Valid values include auth,authpriv,syslog,local0,local1...
# Default value is 'syslog'
syslog_log_facility = syslog
# Which messages to log.
# INFO means log all usage
# ERROR means only log unsuccessful attempts
syslog_log_level = ERROR
# Rootwrap daemon exits after this seconds of inactivity
daemon_timeout = 600
filters_path = /etc/neutron/rootwrap.d,/usr/share/neutron/rootwrap
exec_dirs = /openstack/venvs/neutron- 21.0.0/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin

[xenapi]
# XenAPI configuration is only required by the L2 agent if it is to
# target a XenServer/XCP compute host's dom0.
xenapi_connection_url = <None>
xenapi_connection_username = root
xenapi_connection_password = <None>

/openstack/venvs/neutron-21.0.0/lib/python3.8/site-packages/neutron_vpnaas/services/vpn/device_drivers/template/strongswan/ipsec.conf.template:

# Configuration for {{vpnservice.id}}
config setup
  charondebug="ike 4,knl 4,net 4,enc 4,chd 4,esp 4,cfg 2,dmn 4,mgr 4,asn 4"
conn %default
        keylife=20m
        rekeymargin=3m
        keyingtries=1
        authby=psk
        mobike=no
{% for ipsec_site_connection in vpnservice.ipsec_site_connections%}
conn {{ipsec_site_connection.id}}
    keyexchange={{ipsec_site_connection.ikepolicy.ike_version}}
    left={{ipsec_site_connection.external_ip}}
    leftsubnet={{ipsec_site_connection['local_cidrs']|join(',')}}
    leftid={{ipsec_site_connection.local_id}}
    leftfirewall=yes
    right={{ipsec_site_connection.peer_address}}
    rightsubnet={{ipsec_site_connection['peer_cidrs']|join(',')}}
    rightid={{ipsec_site_connection.peer_id}}
    auto=route
    dpdaction={{ipsec_site_connection.dpd_action}}
    dpddelay={{ipsec_site_connection.dpd_interval}}s
    dpdtimeout={{ipsec_site_connection.dpd_timeout}}s
    ike={{ipsec_site_connection.ikepolicy.encryption_algorithm}}-{{ipsec_site_connection.ikepolicy.auth_algorithm}}-{{ipsec_site_connection.ikepolicy.pfs}}
    ikelifetime={{ipsec_site_connection.ikepolicy.lifetime_value}}s
    {%- if ipsec_site_connection.ipsecpolicy.transform_protocol == "ah" %}
    ah={{ipsec_site_connection.ipsecpolicy.auth_algorithm}}-{{ipsec_site_connection.ipsecpolicy.pfs}}
    {%- else %}
    esp={{ipsec_site_connection.ipsecpolicy.encryption_algorithm}}-{{ipsec_site_connection.ipsecpolicy.auth_algorithm}}-{{ipsec_site_connection.ipsecpolicy.pfs}}
    {%- endif %}
    lifetime={{ipsec_site_connection.ipsecpolicy.lifetime_value}}s
    type={{ipsec_site_connection.ipsecpolicy.encapsulation_mode}}
{% endfor %}

如果有人可以帮助我激活日志,那就太好了

谢谢

解决方法

这不是答案,但使其更具可读性。我们没有接触过charon的配置,但这是/etc/strongswan.d/charon-logging.conf

charon {

    # Section to define file loggers,see LOGGER CONFIGURATION in
    # strongswan.conf(5).
    filelog {

        # <filename> is the full path to the log file.
        # <filename> {

            # Loglevel for a specific subsystem.
            # <subsystem> = <default>

            # If this option is enabled log entries are appended to the existing
            # file.
            # append = yes

            # Default loglevel.
            # default = 1

            # Enabling this option disables block buffering and enables line
            # buffering.
            # flush_line = no

            # Prefix each log entry with the connection name and a unique
            # numerical identifier for each IKE_SA.
            # ike_name = no

            # Prefix each log entry with a timestamp. The option accepts a
            # format string as passed to strftime(3).
            # time_format =

        # }

    }

    # Section to define syslog loggers,see LOGGER CONFIGURATION in
    # strongswan.conf(5).
    syslog {

        # Identifier for use with openlog(3).
        # identifier =

        # <facility> is one of the supported syslog facilities,see LOGGER
        # CONFIGURATION in strongswan.conf(5).
        # <facility> {

            # Loglevel for a specific subsystem.
            # <subsystem> = <default>

            # Default loglevel.
            # default = 1

            # Prefix each log entry with the connection name and a unique
            # numerical identifier for each IKE_SA.
            # ike_name = no
        # }
    }
}
,

除了第一篇文章,我终于设法在配置下激活了日志: 在控制器上:

/etc/strongswan.d/charon-logging.conf

charon {

# Section to define file loggers,see LOGGER CONFIGURATION in                                                                                                                                                                                                              
# strongswan.conf(5).                                                                                                                                                                                                                                                      
filelog {                                                                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                                           
    # <name> may be the full path to the log file if it only contains                                                                                                                                                                                                      
    # characters permitted in section names. Is ignored if path is                                                                                                                                                                                                         
    # specified.                                                                                                                                                                                                                                                           
      charon {                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                           
        # Loglevel for a specific subsystem.                                                                                                                                                                                                                               
        # <subsystem> = <default>                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                           
        # If this option is enabled log entries are appended to the existing                                                                                                                                                                                               
        # file.                                                                                                                                                                                                                                                            
          append = no                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                           
        # Default loglevel.                                                                                                                                                                                                                                                
          default = 3                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                           
        # Enabling this option disables block buffering and enables line                                                                                                                                                                                                   
        # buffering.                                                                                                                                                                                                                                                       
          flush_line = yes                                                                                                                                                                                                                                                 
                                                                                                                                                                                                                                                                           
        # Prefix each log entry with the connection name and a unique                                                                                                                                                                                                      
        # numerical identifier for each IKE_SA.
          ike_name = yes

        # Optional path to the log file. Overrides the section name. Must be
        # used if the path contains characters that aren't allowed in
        # section names.
          path = /var/log/charon-ike.log

        # Adds the milliseconds within the current second after the
        # timestamp (separated by a dot,so time_format should end with %S
        # or %T).
          time_add_ms = yes

        # Prefix each log entry with a timestamp. The option accepts a
        # format string as passed to strftime(3).
          time_format = %b %e %T

      }

}

# Section to define syslog loggers,see LOGGER CONFIGURATION in
# strongswan.conf(5).
syslog {

    # Identifier for use with openlog(3).
 #     identifier = CHARON

    # <facility> is one of the supported syslog facilities,see LOGGER
    # CONFIGURATION in strongswan.conf(5).
    #  auth {

        # Loglevel for a specific subsystem.
        # <subsystem> = <default>

        # Default loglevel.
     #    default = 2

        # Prefix each log entry with the connection name and a unique
        # numerical identifier for each IKE_SA.
      #    ike_name = yes

     # }

   }

}

最重要的是:

sudo apparmor_parser -R /etc/apparmor.d/usr.lib.ipsec.charon

使用此配置,您将在/var/log/charon-ike.log下有一个日志文件。 也许您需要重启中子

感谢您的帮助;)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-