どうもみむらです。
VPN 越しに NAS のコンテンツに、しかも DLNA 対応アプリ経由で触りたいと思ったことはありませんか。
数ヶ月前に NAS を購入して、速攻で静音化の記事 ( ASUSTOR DataSync Center の HDD アクセスを静かにする ) を書いたりしていたのですが、DLNA 経由で音楽ファイルに触れるようにしてみた所これが大変使いやすく、ぜひ VPN 越しにもこれを享受したい・・と。。
DLNA は UPnP を用いており、その機器発見に SSDP (1900/udp) を用いているのですが、早い話が VPN 越しにブロードキャストが上手く動作しないので、これを改善してみようというそういう話です。
1.サーバから VPN 感を感じ取れないようにする
DLNA は同一ネットワーク上での動作を想定しているものになります。
他のネットワークからアクセスしようとすると上手く動いてくれないケースがいくつか見られましたので、下記のようにしてサーバからの 「VPN 感」を少し消してみます。

NAS 側には “192.168.1.0/24” のネットワークに属しているように見せ、VPN 用に “192.168.1.224/28” のネットワークを用意しておきます。
VPN サーバには Proxy ARP の設定を入れて、192.168.1.0/24 のネットワーク上からも 192.168.1.224/28 の端末の MAC アドレスの解決 (といっても VPN サーバが指し示されるだけ)が出来るようになります。
なお、Proxy ARP については、こちらのサイトが詳しいですので参照ください:
Proxy ARP(プロキシARP)とは / ネットワークエンジニアとして
https://www.infraexpert.com/study/gateway.htm
具体的な設定方法としては
“/proc/sys/net/ipv4/conf/<device>/proxy_arp” を 1 に書き換えるか
systemd-networkd の “[Network]” セクションに “IPv4ProxyARP=yes” とする方法が
簡単かなと思います。
設定する際は、“192.168.1.0/24” の方に ProxyARP の設定を適用する形になります。
systemd-networkd の設定例)
# cat /etc/systemd/network/eth0.network
[Match]
Name=eth0
[Network]
Address=192.168.1.240/24
Gateway=192.168.1.254
IPv4ProxyARP=yes
# cat /etc/systemd/network/eth1.network
[Match]
Name=eth1
[Network]
Address=192.168.1.238/28
[Link]
MTUBytes=12002. SSDP をプロキシする
探索プロトコルの通信を転送するようにしてみます。
転送しないと探索が VPN のネットワーク内で閉じてしまい、本来の機器まで届かなくなってしまいます。
SSDP の中身は概ね下記のような HTTP ベースの通信になっています。
# リクエストの例。(クライアントからサーバに対して送る)
# 239.255.255.250:1900/UDP に対して送出される
---
M-SEARCH * HTTP/1.1
MX: 5
ST: urn:schemas-upnp-org:device:MediaServer:1
MAN: "ssdp:discover"
User-Agent: UPnP/1.0
Host: 239.255.255.250:1900
Connection: close
---
# 応答例。
# サーバからリクエストを行ったクライアントのポートに対してユニキャストで応答が入る
---
HTTP/1.1 200 OK
Cache-Control: max-age=1800
EXT:
Location: http://192.168.1.22:55247/dms
Server: Linux 4.0.0 UPnP/1.0
ST: urn:schemas-upnp-org:device:MediaServer:1
USN: uuid:xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx::urn:schemas-upnp-org:device:MediaServer:1
Date: Sun, 16 May 2021 19:42:50 GMT
---見ていただくとわかるように、応答の中にユニキャストアドレスが含まれているため、発見処理のみプロキシしてあげれば後は1対1での通信となります。
ということで下記のようなプログラムを書いてみました
#!/bin/python3
#
# SSDP (DLNA の探索プロトコル) を吸って吐くプロキシ。
# Wireguard のように純粋にbridgeできないネットワーク間で使うと幸せになれる気がします。
# (使ったことでネットワークがダウン等しても保証は出来ませんので、自己責任でどうぞ。)
#
# Author : Satoshi Mimura (@mimura1133)
#
import socket
from contextlib import closing
def main():
multicast_group = '239.255.255.250'
src_adapter_ip = '' # DLNA クライアントがいるネットワークの IP アドレスを指定
dst_adapter_ip = '' # DLNA サーバがいるネットワークの IP アドレスを指定
port = 1900
timeout = 5.0
with closing(socket.socket(socket.AF_INET,socket.SOCK_DGRAM)) as src_sock:
src_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1)
src_sock.bind(('',port))
src_sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP,
socket.inet_aton(multicast_group) + socket.inet_aton(src_adapter_ip))
while True:
request_data, client_addr = src_sock.recvfrom(4096)
with closing(socket.socket(socket.AF_INET,socket.SOCK_DGRAM)) as dst_sock:
dst_sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_IF, socket.inet_aton(dst_adapter_ip))
dst_sock.settimeout(timeout)
dst_sock.sendto(request_data,(multicast_group,port))
print("\033[31m [FORWARDED:REQUEST]\033[0m {} -> {}".format(client_addr,(multicast_group,port)))
print(request_data)
while True:
try:
response_data, server_addr = dst_sock.recvfrom(4096)
src_sock.sendto(response_data,client_addr)
print("\033[32m [FORWARDED:RESPONSE]\033[0m {} -> {}".format(server_addr,client_addr))
print(response_data)
except Exception:
break
return
if __name__ == '__main__':
main()動かしてみた結果は下図の通り。中々上手く動いてます。


3.永続化する
毎回手動で起動するのは筋がよくありませんので、systemd のサービスにしてしまいましょう。
まずは、先ほどの Proxy をするプログラムからデバッグ用の print 文を消去したものを準備します。
#!/bin/python3
#
# SSDP (DLNA の探索プロトコル) を吸って吐くプロキシ。
# Wireguard のように純粋にbridgeできないネットワーク間で使うと幸せになれる気がします。
# (使ったことでネットワークがダウン等しても保証は出来ませんので、自己責任でどうぞ。)
#
# Author : Satoshi Mimura (@mimura1133)
#
import socket
from contextlib import closing
def main():
multicast_group = '239.255.255.250'
src_adapter_ip = '' # DLNA クライアントがいるネットワークの IP アドレスを指定
dst_adapter_ip = '' # DLNA サーバがいるネットワークの IP アドレスを指定
port = 1900
timeout = 5.0
with closing(socket.socket(socket.AF_INET,socket.SOCK_DGRAM)) as src_sock:
src_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR,1)
src_sock.bind(('',port))
src_sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP,
socket.inet_aton(multicast_group) + socket.inet_aton(src_adapter_ip))
while True:
request_data, client_addr = src_sock.recvfrom(4096)
with closing(socket.socket(socket.AF_INET,socket.SOCK_DGRAM)) as dst_sock:
dst_sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_IF, socket.inet_aton(dst_adapter_ip))
dst_sock.settimeout(timeout)
dst_sock.sendto(request_data,(multicast_group,port))
while True:
try:
response_data, server_addr = dst_sock.recvfrom(4096)
src_sock.sendto(response_data,client_addr)
except Exception:
break
return
if __name__ == '__main__':
main()上記を /usr/local/sbin/proxy_dlna.py として保存しておきます。
保存が完了したら下記のように systemd のサービスを作成します。
今回は下記の内容を /etc/systemd/system/proxy_dlna.service として作成しました。
[Unit]
Description=Launch DLNA Proxy (/usr/local/sbin/proxy_dlna.py)
# After=wg-quick@wg0.service #WireGuard を使っている場合はこうしておくと WireGuard が起動した後に起動するようになります。
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/proxy_dlna.py
[Install]
WantedBy=multi-user.target保存が完了しましたら systemctl enable proxy_dlna 等で有効にすれば完了です。
手順は以上となります。
ただ上記のようなプロキシで全て動作するかというとそうではなく、特に DTCP-IP 等を用いるシステムの場合は「TTL は 3ホップ以下」「RTT は 7ms 以下」という制約が存在するため実現するのが大変難しい状況になっています。
もしそのような場合については NTT の NGN 網の特殊性を用いて回避しているケースや、L2TPv3 などを上手く組み合わせて回避しているケースがネット上にいくつか転がっていますのでそちらを用いるのが良いかなと思われます。
とはいえ、当方環境ではこれで VPN ライフがかなり改善されましたので、もしよろしければ参考にしていただけたらと!
https://classic-blog.udn.com/bb820e80/183835757
Another can’t-miss palettes for mother of the bride or mom of the groom dresses?
https://telegra.ph/cateringking-3-10-29
Also, a lace shirt and fishtail skirt is a trendy choice that has “elegance” weaved into its seams.
https://classic-blog.udn.com/772ce78b/183949571
It can be used for any event, and the fashion of it’s good for the mother of the bride.
https://telegra.ph/SEO-2-11-03
Both the mom of the bride and the mother of the groom chose hanging robes with embellishment and phantasm necklines for this outdoor celebration.
https://ameblo.jp/randythompson2391/entry-12949057489.html
You’ll find understated A-line dresses and fabulous sheath numbers.
https://classic-blog.udn.com/7ed0d0a8/184596364
If full skirts and punchy prints aren’t your mom’s go-to, try a press release sleeve.
https://classic-blog.udn.com/78ccd7b0/184137132
Make certain to let the mother of the groom know what you might be sporting.
https://classic-blog.udn.com/1935c3f4/184374149
Another can’t-miss palettes for mother of the bride or mom of the groom dresses?
https://classic-blog.udn.com/c3e4b423/183826544
You should go for some shiny colours, or in case your daughter has a color picked out for you then go with that.
https://classic-blog.udn.com/1abe8f4a/183571730
While you don’t wish to seem like a bridesmaid , it is savvy to tie in your look with the feel and color palette of the marriage.
https://classic-blog.udn.com/5ccf35ae/183974308
In brief, yes, however provided that it goes with the texture of the day.
https://ducngantran.wordpress.com/2025/10/17/6/
Modest meets insanely fashionable in this silky Amsale robe that includes a column silhouette and off-the-shoulder neckline.
https://patrick53543.jimdofree.com/2025/12/15/2/
These robes are chic and fashionable with only a little bit of an edge.
https://classic-blog.udn.com/b1f75e6e/183511962
To encourage your mother’s own choose, we’ve rounded up a collection of robes that actual mothers wore on the massive day.
https://lhem2863.blogspot.com/2025/11/blog-post_22.html
This is extra of a personal selection that is decided between you and your daughter.
https://fumina8262.exblog.jp/35427818/
In quick, yes, however provided that it goes with the feel of the day.
https://classic-blog.udn.com/74674140/183954292
Gone are the times when moms of the bride were expected to put on matronly dresses in washed-out shades of pastels or beige.
https://classic-blog.udn.com/c5dcf900/184542908
(I don’t assume he’ll benefit from the journey of buying with me).
https://exrijxcjuyrcvh56.exblog.jp/35126336/
Pair the dress with impartial or metallic equipment to keep the relaxation of the look subtle and simple.
https://qr.ae/pCMEGP
This embellishment on this beautiful dress adds a touch of magic excellent for any winter wedding ceremony.
https://classic-blog.udn.com/163ce521/183907390
Wear it to a backyard celebration with block heels or wedges.
https://classic-blog.udn.com/f4bde43d/183864934
With a gentle fit at the hips, this dress is designed to flatter you in all the best locations.
https://ameblo.jp/judithjohnson1138/entry-12949522251.html
This gown comes with a sweater over that may be taken off if it gets too hot.
https://combative-flory-b7tmb59n.dcms.site/K41EMx
Moms who want to give somewhat drama, think about vivid hues and statement features.
https://classic-blog.udn.com/337e230a/184251771
The dress is figure-hugging and presents a easy silhouette.
https://mypaper.pchome.com.tw/ianwatts46/post/1382133424
As the mother of the bride, eyes shall be on you virtually as a lot as they will be on the pleased couple.
https://deadpan-legend-2ac.notion.site/2b68e2cef5df807680b4c00727526d7d
At as soon as easy and refined, this superbly draped robe is the right hue for a fall marriage ceremony.
https://classic-blog.udn.com/3e5fd5fd/184628008
For moms who swoon for all issues sassy, the dramatic gold mom of the bride dress can be the picture-perfect pick in 2022.
https://telegra.ph/cateringking-8-10-01-2
Discover our hand-picked assortment of mom of the bride dresses and you’re assured to be best-dressed – aside from the bride, of course!
https://classic-blog.udn.com/0931dbe1/183864169
An occasion as special as your kid’s marriage ceremony does not come round daily.
https://telegra.ph/cateringking-3-10-21
Shop now by way of various retailers, together with official online shops.
https://classic-blog.udn.com/27d19937/184027344
If you are looking to splurge on a MOB gown, you will find plenty of glam options here.
https://classic-blog.udn.com/2799273d/183785265
Experiment with strapless styles, sudden lengths, or trendy jumpsuits.
https://doxuantam036.blogspot.com/2025/10/blog-post.html
Even better, it will look nice paired with heeled or flat sandals—whichever helps you’re feeling your best on the dance flooring.
https://classic-blog.udn.com/article/post.jsp?xid=be8602a7
Thus, you should not put on white if you end up the mom of the bride and even something like ivory.
https://nicolewoodard8047.jimdofree.com/2025/12/09/2/
Mother of the bride dresses needn’t feel frumpy or overly conservative!
https://telegra.ph/cateringking-7-10-21
Inspired by bold flowers, a blooming print pops off each inch of this strapless ball gown, from the phantasm plunge corset bodice to the complete, sweeping skirt.
https://gihcuorww95.amebaownd.com/posts/58312020
Moms who wish to give a little drama, contemplate vivid hues and assertion options.
https://classic-blog.udn.com/d86d3ab8/184060846
But for others, it’s restrictive, it feels too formal, and sometimes, it finally ends up being rather costly too.
https://ameblo.jp/thomas2342/entry-12949771779.html
If stylish and complex is what you are going for, contemplate this sequined ensemble from Alex Evenings.
https://classic-blog.udn.com/514b3273/183453890
Browse by scoop necklines or check out the strapless choices.
https://meghanclark5335.neocities.org/MeghanClark53353
The subsequent factor you have to think about when shopping round for attire is the form of the costume.
https://doxuantam036.exblog.jp/35033635/
This mother also wore Nigerian apparel, and paired her lace wrap dress with a chartreuse gele.