AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 796872
Accepted
4_dev
4_dev
Asked: 2016-08-16 03:31:16 +0800 CST2016-08-16 03:31:16 +0800 CST 2016-08-16 03:31:16 +0800 CST

openvpn radius-plugin 不会将 freeradius 中的 framed-ip-address 分配给客户端

  • 772

我是openvpn的新手。我在 ubuntu 14.04 上有一个 openvpn 设置,它有一个用于身份验证、授权和记帐的半径 AAA 后端。除此之外,我们还配置了 freeradius 以将池中的 ips 分配为 framed-ip-address。从半径日志来看,当身份验证和授权成功时,freeradius 似乎返回 framed-ip-address 以响应访问请求消息,但 openvpn 似乎忽略它并使用服务器指令中指定的自己的 ip 池。我想要的是openvpn尊重freeradius返回的框架IP地址,但事实并非如此。由于我之前没有使用 openvpn 的经验,因此我希望得到专家的帮助。

这是我认为有问题的配置的 openvpn 方面。

OpenVPN 配置:

local 192.168.7.100

mode server

port 443 

proto tcp 

dev tun

tcp-queue-limit 256

tun-mtu 1500

mssfix 1460

sndbuf 0

rcvbuf 0


cipher AES-256-CBC

ca /etc/openvpn/easy-rsa/keys/ca.crt

cert /etc/openvpn/easy-rsa/keys/server.crt

key /etc/openvpn/easy-rsa/keys/server.key

dh /etc/openvpn/easy-rsa/keys/dh2048.pem

tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0

plugin /etc/openvpn/rad/radiusplugin.so /etc/openvpn/rad/443.cnf

client-cert-not-required

username-as-common-name


server 10.10.0.0 255.255.0.0

;ifconfig-pool 10.0.0.0 10.1.255.254

ifconfig-pool-persist ipp.txt

push "redirect-gateway def1"

push "dhcp-option DNS 8.8.8.8"

push "dhcp-option DNS 8.8.4.4"

reneg-sec 0

keepalive 60 120

tcp-nodelay

comp-lzo

persist-key

persist-tun

status /etc/openvpn/443.log 1

status-version 1

verb 4

management 192.168.7.100 7505

半径插件:

NAS-Identifier=openvpn_tcp_443

Service-Type=5

Framed-Protocol=1

NAS-Port-Type=5

NAS-IP-Address=192.168.7.100

OpenVPNConfig=/etc/openvpn/tcp_443.conf


subnet=255.255.255.0


overwriteccfiles=true

nonfatalaccounting=false

server
{

        acctport=1813

        authport=1812

        name=192.168.7.102

        retry=1

        wait=1

        sharedsecret=--redacted--
}

server
{

        acctport=1813

        authport=1812

        name=192.168.7.103

        retry=1

        wait=1

        sharedsecret=--redacted--
}

谢谢你。

=======================

更新

我对配置进行了以下更改。

topology subnet

push "topology subnet"

client-config-dir clients

添加 client-config-dir 后,正在分配 framed-ip-address。如前所述,现在从我的客户那里,我无法浏览任何内容。似乎无法正确路由流量。似乎存在路由问题或拓扑或其他我希望 openvpn 处理的问题,但事实并非如此。以下是可以帮助其理解的相关信息。

分配给openvpn客户端的ip是公网ip,路由设置在本机网关上。与 strongswan 一起使用时,相同的客户端 ip 可以正常工作。这意味着它可以正确路由。但是对于openvpn,它不会。

服务器机器上 ifconfig 的相关输出。

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00

          inet addr:10.10.0.1  P-t-P:10.10.0.1  Mask:255.255.255.0

          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

route -n 的相关输出

0.0.0.0         --redacted--     0.0.0.0         UG    0      0        0 em2

10.10.0.0       0.0.0.0         255.255.255.0   U     0      0        0 tun0

--redacted--     0.0.0.0         255.255.255.248 U     0      0        0 em2

rp_filter 信息:

root@us1-ps1:~# sysctl -a | grep rp_filter

net.ipv4.conf.all.arp_filter = 0

net.ipv4.conf.all.rp_filter = 1

net.ipv4.conf.default.arp_filter = 0

net.ipv4.conf.default.rp_filter = 0

net.ipv4.conf.em1.arp_filter = 0

net.ipv4.conf.em1.rp_filter = 0

net.ipv4.conf.em2.arp_filter = 0

net.ipv4.conf.em2.rp_filter = 0

net.ipv4.conf.lo.arp_filter = 0

net.ipv4.conf.lo.rp_filter = 0

net.ipv4.conf.tun0.arp_filter = 0

net.ipv4.conf.tun0.rp_filter = 0


root@us1-ps1:~# ping 10.10.0.1

PING 10.10.0.1 (10.10.0.1) 56(84) bytes of data.

64 bytes from 10.10.0.1: icmp_seq=1 ttl=64 time=0.058 ms

64 bytes from 10.10.0.1: icmp_seq=2 ttl=64 time=0.037 ms

互联网工作正常。

root@us1-ps1:~# ping google.com

PING google.com (172.217.0.46) 56(84) bytes of data.

64 bytes from lga15s43-in-f14.1e100.net (172.217.0.46): icmp_seq=1 ttl=51 time=20.3 ms

64 bytes from lga15s43-in-f14.1e100.net (172.217.0.46): icmp_seq=2 ttl=51 time=20.2 ms

64 bytes from lga15s43-in-f14.1e100.net (172.217.0.46): icmp_seq=3 ttl=51 time=20.2 ms

^C
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 20.216/20.279/20.338/0.171 ms

默认网关也可以ping通。

如果您想打印其他信息,请告诉我。

谢谢

openvpn freeradius freeradius2
  • 1 1 个回答
  • 2427 Views

1 个回答

  • Voted
  1. Best Answer
    Catopleba
    2016-08-17T09:30:46+08:002016-08-17T09:30:46+08:00

    指定client-config-dir指令。是半径插件将放置openvpn用于分配IP的文件的位置。

    例如。客户端配置目录客户端

    • 1

相关问题

  • OpenVPN:在哪里生成私钥?

  • 将 iPhone 连接到 OpenVPN

  • OpenVPN 的 Linux IP 转发 - 正确的防火墙设置?

  • 最好的点对点 VPN?

  • 通过 VPN 使您的打印机可用的最佳方法是什么?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve