1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SSTPとEoIPについて勉強してみる

1
Last updated at Posted at 2026-06-01

困ったこと

最近、MikroTikのhexシリーズを使う機会があるのですが、、、
あまり理解していないし、うまく使えていない気がする。。。

他のVPNルータに比べて特殊な気がする。

ということで、今回はEoIPとSSTPについて勉強してみる!

SSTPとEoIPとは?

SSTP

Secure Socket Tunneling Protocolの略

  • Secure → 暗号化
  • Socket → HTTP通信
  • Tunnel →VPN

つまり、HTTPSを使用したVPN

【特徴】
1-TCP443を使う
上でも書いた通り、HTTPSを使用するのでポート番号は443を使用する。
利点として、学校や会社やホテルなどのセキュリティに厳しい場合でも通りやすい。

2-SSL/TLSで暗号化
HTTPSと同じ技術を使用して暗号化をしている
盗聴・改ざんがされにくい。

3-NAT超えが得意
IPsecより通りやすいことが多い。

EoIP

Ethernet over IPの略
つまり、「EthernetフレームをIP上でそのまま運ぶ」ということ

【特徴】
1-暗号化はしない
EoIPは暗号化はしておらず、そのまま送っているので、インターネット上を通るならば単体で使用するととても危険

2-Ethernetそのものを運ぶ
つまり、Macアドレス・VLANタグ・ARP・ブロードキャストなどのL"パケットをそのまま送信
本拠地と遠隔地が同じL2スイッチに刺さっているイメージ。

L2TPと何が違うのか?

L2TPはEoIPとは違い、PPP通信を運ぶ。
L2TPv3なら、L2の延伸は可能。これはEthernetを運ぶから。

準備は以下の記事

設定してみる

今回は勉強している通り、MikrotikのRouterOSを使用して「EoIP over SSTP」を実装してみる。
使用するバージョンは「7.21.4(long-term)」

構成図は以下の通り
image.png

hexルータ以外の設定

ポートフォワーディング

今回の環境では、サーバ側のhexルータに直接パブリックIPをふることができない。
そこで、今回は仮想ONUにポートフォワーディングを入れた。

  • wanポート:443 → hexルータ:443

サーバ側の設定

各ポートの物理アドレス

LANポート(bridge): 192.168.88.1
WANポート : 192.168.8.161(DHCPで取得)

EoIP Tunnel設定

Advanced > Interfaces > EoIP Tunnel > New

設定項目 設定値 備考
Name eoip-tunnel1 今回はデフォルト
MTU 1458 フラグメントの防止
Remote Address 10.10.0.2 クライアントのVPNインターフェースのアドレス
Tunnel ID 1
IPSec Secret "任意のキー"
Clamp TCP MSS チェックなし
Allow Fast Path チェックなし

PPP設定(SSTPサーバ)

Advanced > PPP > Interface > SSTP Server

設定項目 設定値 備考
Enabled チェック
Port 443 今回はデフォルト
Default Profile default-encryption

PPP設定(SSTP認証)

Advanced > PPP > Secrets > New

設定項目 設定値 備考
Enabled チェック
Name sstptest1
Password "任意のキー"
Profile default-encryption
Local Address 10.10.0.1
Remote Address 10.10.0.2

Bridge設定

Advanced > Bridge > Ports > New

設定項目 設定値 備考
Interface eoip-tunnel1 EoIP設定で作成したインターフェース
Bridge bridge

Firewall 設定

Advanced > IP > Firewall Fillter Rules > New

設定項目 設定値 備考
Chain input
Protocol tcp
Dst Port 443 SSTPで設定したポート
Action accept

ここは使用環境のセキュリティに合わせて。

サーバ側のconfig

exportコマンドで出力することができ、更にterse をつけると各項目が一行で表示される。

[admin@MikroTik] > export
# 2026-06-01 09:55:18 by RouterOS 7.21.4
# software id = 99B2-76BG
#
/interface bridge
add name=bridge
/interface ethernet
set [ find default-name=ether1 ] disable-running-check=no
set [ find default-name=ether2 ] disable-running-check=no
/interface eoip
add allow-fast-path=no clamp-tcp-mss=no !keepalive mac-address=<MACアドレス> mtu=1458 name=eoip-tunnel1 \
remote-address=10.10.0.2 tunnel-id=1
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/interface bridge port
add bridge=bridge interface=ether2
add bridge=bridge interface=eoip-tunnel1
/interface sstp-server server
set default-profile=default-encryption enabled=yes port=443
/ip address
add address=192.168.88.1/24 interface=bridge network=192.168.88.0
/ip dhcp-client
add interface=ether1
/ip firewall filter
add action=accept chain=input protocol=gre
add action=accept chain=input dst-port=443 protocol=tcp
/ppp secret
add local-address=10.10.0.1 name=sstptest1 profile=default-encryption remote-address=10.10.0.2



[admin@MikroTik] > export terse
# 2026-06-01 09:55:22 by RouterOS 7.21.4
# software id = 99B2-76BG
#
/interface bridge add name=bridge
/interface ethernet set [ find default-name=ether1 ] disable-running-check=no
/interface ethernet set [ find default-name=ether2 ] disable-running-check=no
/interface eoip add allow-fast-path=no clamp-tcp-mss=no !keepalive mac-address=<MACアドレス> mtu=1458 name=eoip-tunnel1 remote-address=10.10.0.2 tunnel-id=1
/interface wireless security-profiles set [ find default=yes ] supplicant-identity=MikroTik
/interface bridge port add bridge=bridge interface=ether2
/interface bridge port add bridge=bridge interface=eoip-tunnel1
/interface sstp-server server set default-profile=default-encryption enabled=yes port=443
/ip address add address=192.168.88.1/24 interface=bridge network=192.168.88.0
/ip dhcp-client add interface=ether1
/ip firewall filter add action=accept chain=input protocol=gre
/ip firewall filter add action=accept chain=input dst-port=443 protocol=tcp
/ppp secret add local-address=10.10.0.1 name=sstptest1 profile=default-encryption remote-address=10.10.0.2
/system gps set set-system-time=no

クライアント側の設定

各ポートの物理アドレス

LANポート(bridge): 192.168.88.2
WANポート : 192.168.100.11(DHCPで取得)

EoIP Tunnel設定

Advanced > Interfaces > EoIP Tunnel > New

設定項目 設定値 備考
Name eoip-tunnel1 今回はデフォルト
MTU 1458 フラグメントの防止
Remote Address 10.10.0.1 クライアントのVPNインターフェースのアドレス
Tunnel ID 1
IPSec Secret "任意のキー"
Clamp TCP MSS チェックなし
Allow Fast Path チェックなし

PPP設定(SSTPクライアント)

Advanced > PPP > Interface > New > SSTP Client

設定項目 設定値 備考
Name SSTP-out1 今回はデフォルト
Connect To サーバ側の固定パブリックIP 今回はDDNS未使用
Port 443
Proxy Port 443
User sstptest1
Password "任意のキー"

Bridge設定

Advanced > Bridge > Ports > New

設定項目 設定値 備考
Interface eoip-tunnel1 EoIP設定で作成したインターフェース
Bridge bridge

Firewall 設定

Advanced > IP > Firewall Fillter Rules > New

設定項目 設定値 備考
Chain input
Protocol tcp
Dst Port 443 SSTPで設定したポート
Action accept

サーバ側のconfig

[admin@MikroTik] > export
# 2026-04-21 03:45:11 by RouterOS 7.21.4
# software id = QR8B-MUZV
#
/interface bridge
add name=bridge
/interface ethernet
set [ find default-name=ether1 ] disable-running-check=no
set [ find default-name=ether2 ] disable-running-check=no
/interface eoip
add allow-fast-path=no clamp-tcp-mss=no !keepalive mac-address=<MACアドレス> mtu=1400 name=eoip-tunnel1 \
remote-address=10.10.0.1 tunnel-id=1
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/interface sstp-client
add connect-to=<サーバアドレス> disabled=no http-proxy=0.0.0.0 name=sstp-out1 port=443 profile=default-encryption \
proxy-port=50443 user=sstptest1
/interface bridge port
add bridge=bridge interface=ether2
add bridge=bridge interface=eoip-tunnel1
/ip address
add address=192.168.88.2/24 interface=bridge network=192.168.88.0
/ip dhcp-client
add interface=ether1
/ip firewall filter
add action=accept chain=input protocol=gre
add action=accept chain=input dst-port=443 protocol=tcp



[admin@MikroTik] > export terse
# 2026-04-21 03:45:16 by RouterOS 7.21.4
# software id = QR8B-MUZV
#
/interface bridge add name=bridge
/interface ethernet set [ find default-name=ether1 ] disable-running-check=no
/interface ethernet set [ find default-name=ether2 ] disable-running-check=no
/interface eoip add allow-fast-path=no clamp-tcp-mss=no !keepalive mac-address=<MACアドレス> mtu=1400 name=eoip-tunnel1 remote-address=10.10.0.1 tunnel-id=1
/interface wireless security-profiles set [ find default=yes ] supplicant-identity=MikroTik
/interface sstp-client add connect-to=<サーバアドレス> disabled=no http-proxy=0.0.0.0 name=sstp-out1 port=443 profile=default-encryption proxy-port=50443 user=sstptest1
/interface bridge port add bridge=bridge interface=ether2
/interface bridge port add bridge=bridge interface=eoip-tunnel1
/ip address add address=192.168.88.2/24 interface=bridge network=192.168.88.0
/ip dhcp-client add interface=ether1
/ip firewall filter add action=accept chain=input protocol=gre
/ip firewall filter add action=accept chain=input dst-port=443 protocol=tcp

確認

設定はできたので実際に「EoIP over SSTP」が構成できているか確認してみる。

一番簡単な方法は、、、

相手のLANポートにPingを飛ばす

クライアント側
[admin@MikroTik] > ping 192.168.88.2
0 192.168.88.1                               56  64 225ms205us
1 192.168.88.1                               56  64 123ms87us
2 192.168.88.1                               56  64 113ms506us
3 192.168.88.1                               56  64 117ms824us

sent=6 received=6 packet-loss=0% min-rtt=113ms506us avg-rtt=140ms506us max-rtt=225ms205us

詳しく確認してみる

サーバ側で確認する

  • SSTP
[admin@MikroTik] > /ppp active print detail
Flags: R - radius
0   name="sstptest1" service=sstp caller-id=<クライアントのグローバルIP> address=10.10.0.2 uptime=7h16m39s
encoding="AES256-CBC" session-id=0x81000002 limit-bytes-in=0 limit-bytes-out=0
  • EoIP
[admin@MikroTik] > /interface eoip print detail
Flags: X - disabled; R - running
0  R name="eoip-tunnel1" mtu=1458 actual-mtu=1458 l2mtu=65535 mac-address=<MACアドレス> arp=enabled
arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s
loop-protect-disable-time=5m local-address=0.0.0.0 remote-address=10.10.0.2 tunnel-id=1 dscp=inherit
clamp-tcp-mss=no dont-fragment=no allow-fast-path=no
  • 本当にL2延伸できるか?
[admin@MikroTik] > /interface bridge host print
Flags: D - DYNAMIC; L - LOCAL
Columns: MAC-ADDRESS, ON-INTERFACE, BRIDGE
#    MAC-ADDRESS        ON-INTERFACE  BRIDGE
0 DL <MACアドレス>  bridge        bridge
1 D  <MACアドレス>  ether2        bridge
2 D  <MACアドレス>  ether2        bridge
3 D  <MACアドレス>  ether2        bridge
4 D  <MACアドレス>  ether2        bridge
5 D  <MACアドレス>  eoip-tunnel1  bridge
6 DL <MACアドレス>  eoip-tunnel1  bridge
7 D  <MACアドレス>  ether2        bridge
8 D  <MACアドレス>  eoip-tunnel1  bridge

eoip-tunnel1 から学習していればOK


クライアント側

  • SSTP
[admin@MikroTik] > /interface sstp-client print detail
Flags: X - disabled; R - running; H - hw-crypto
0  R  name="sstp-out1" max-mtu=1500 max-mru=1500 mrru=disabled connect-to=<サーバIP> port=443
http-proxy=0.0.0.0 proxy-port=443 certificate=none verify-server-certificate=no
verify-server-address-from-certificate=yes user="sstptest1" profile=default-encryption
keepalive-timeout=60 add-default-route=no dial-on-demand=no authentication=pap,chap,mschap1,mschap2
pfs=no tls-version=any ciphers=aes256-sha add-sni=no
  • EoIP
[admin@MikroTik] > /interface eoip print detail
Flags: X - disabled; R - running
0  R name="eoip-tunnel1" mtu=1400 actual-mtu=1400 l2mtu=65535 mac-address=<MACアドレス> arp=enabled
arp-timeout=auto loop-protect=default loop-protect-status=off loop-protect-send-interval=5s
loop-protect-disable-time=5m local-address=0.0.0.0 remote-address=10.10.0.1 tunnel-id=1 dscp=inherit
clamp-tcp-mss=no dont-fragment=no allow-fast-path=no
  • 本当にL2延伸できるか?
[admin@MikroTik] > /interface bridge host print
Flags: D - DYNAMIC; L - LOCAL
Columns: MAC-ADDRESS, ON-INTERFACE, BRIDGE
#    MAC-ADDRESS        ON-INTERFACE  BRIDGE
0 D  <MACアドレス>  eoip-tunnel1  bridge
1 D  <MACアドレス>  eoip-tunnel1  bridge
2 D  <MACアドレス>  eoip-tunnel1  bridge
3 DL <MACアドレス>  eoip-tunnel1  bridge
4 D  <MACアドレス>  eoip-tunnel1  bridge
5 D  <MACアドレス>  eoip-tunnel1  bridge
6 DL <MACアドレス>  bridge        bridge

eoip-tunnel1 から学習していればOK

機能的に確認してみる

サーバとクライアントのそれぞれのLANポートに、DHCPサーバとDHCPクライアントをそれぞれ接続。
DHCPでアドレスを取得できればOK

最後に

ネットワークは楽しいぞ!!
NAT超えが得意なVPNは好きだぞ!!

DDNS機能についても次回は触りたい。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?