首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >禁用某些本地设备的VPN,例如需要ssh进入的嵌入式Linux板(在使用VPN时允许本地(LAN)访问)

禁用某些本地设备的VPN,例如需要ssh进入的嵌入式Linux板(在使用VPN时允许本地(LAN)访问)
EN

Ask Ubuntu用户
提问于 2022-10-25 20:40:00
回答 1查看 236关注 0票数 0

我的Ubuntu18.04机器上有Cisco Annyconnect。我还插入了一个嵌入式Linux板,我需要连接到over。

但是,每当我连接到我的虚拟专用网时,我就不能再和我的本地板交谈了(ping 10.1.2.3与连接的VPN失败了,ssh root@10.1.2.3也是一样)。如何仅禁用此板的VPN,使与此本地板对话的接口不通过VPN?

示例信息:

  1. 我的主要Ubuntu机器:
    1. 连接到本地Linux板的接口名(如ifconfig所示):enxf8e43b9df776
    2. 本地Linux板的静态IP:10.1.2.1
    3. 网络掩码:255.255.255.0

  2. 本地嵌入式Linux板,我需要ssh进入:
    1. 静态IP地址:10.1.2.3
    2. 网络掩码:255.255.255.0

这对我不管用:是否有可能停止在某些应用程序上使用VPN?

我需要能够使用VPN连接到一些远程网络,同时使用我的本地嵌入式Linux板。

可能有用:

  1. https://www.cisco.com/c/en/us/support/docs/security/asa-5500-x-series-next-generation-firewalls/70847-local-lan-pix-asa.html
    1. grep -rn 'LocalLanAccess' /opt/cisco
    2. grep -rn '

  2. 我需要尝试这一点;这就是黑客!-构建一个自定义函数,C++名称-mangling等等!--并在库加载时预加载它,以便用该名称覆盖内部函数:超级用户:如何允许本地局域网访问,同时连接到思科VPN?
  3. OpenConnect --一种尝试的替代方案,它显然与Cisco AnyConnect 兼容。
    1. https://gitlab.com/openconnect/openconnect
    2. http://www.infradead.org/openconnect/

以下是我做的一些没有解决问题或有用的事情(至少现在还没有):

代码语言:javascript
复制
grep -rn 'LocalLanAccess' /opt/cisco


$ grep -rn 'LocalLanAccess' /opt/cisco
/opt/cisco/anyconnect/.anyconnect_global:15:false
Binary file /opt/cisco/anyconnect/lib/libvpnapi.so matches
Binary file /opt/cisco/anyconnect/lib/libvpnagentutilities.so matches
/opt/cisco/anyconnect/profile/vpn_profile.xml:15:       false
/opt/cisco/anyconnect/profile/AnyConnectProfile.xsd:325:            


cp -i /opt/cisco/anyconnect/.anyconnect_global /opt/cisco/anyconnect/.anyconnect_global.bak
cp -i /opt/cisco/anyconnect/profile/vpn_profile.xml /opt/cisco/anyconnect/profile/vpn_profile.xml.bak
cp -i /opt/cisco/anyconnect/profile/AnyConnectProfile.xsd /opt/cisco/anyconnect/profile/AnyConnectProfile.xsd.bak


# manually update all 3 files to true

$ grep -rn 'LocalLanAccess' /opt/cisco
/opt/cisco/anyconnect/.anyconnect_global:15:true
Binary file /opt/cisco/anyconnect/lib/libvpnapi.so matches
Binary file /opt/cisco/anyconnect/lib/libvpnagentutilities.so matches
/opt/cisco/anyconnect/profile/vpn_profile.xml:15:       true
/opt/cisco/anyconnect/profile/AnyConnectProfile.xsd:325:            
EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2022-11-16 21:48:50

解决了!

而是通过openconnect包装器使用openconnect-sso!思科AnyConnect故意阻止局域网访问。

openconnect-sso的基本用法:

代码语言:javascript
复制
VPN_SERVER_ADDRESS="myvpn.whatever.com"   # example server address to connect to
VPN_SAML_GROUP="whatever-saml-whatever"   # example SAML group name
VPN_USER="my.username@something.com"      # example username
# or perhaps just this for the username:
# VPN_USER="my.username"

# connect via `openconnect-sso`
# The first time ever, you must specify everything
openconnect-sso --server "${VPN_SERVER_ADDRESS}/${VPN_SAML_GROUP}" --user "${VPN_USER}"
# Subsequent connection attempts can be done with just this, since apparently
# the server address, SAML group, and username are cached after the first usage
openconnect-sso

有关full的详细信息、屏幕截图和安装说明,请参见我的回答:如何使用"openconnect“(通过openconnect-sso),通过Okta单点登录(SSO)进行双因素身份验证。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1437348

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档