1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

OpenWrt IPv6

Last updated at Posted at 2023-06-30

はじめに

初心者対応構成

  • スクリプトでの自動設定
  • UCIとLuCi及びWinSCPにて比較しながら作業がおススメ

PowerShellSSHアクセス

ssh root@192.168.1.1
ssh root@192.168.1.1のショートカット作成(デスクトップ)
powershell
$DESKTOP = ([Environment]::GetFolderPath("Desktop") + "\192.168.1.1.lnk")
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$DESKTOP")
$Shortcut.TargetPath = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe"
$Shortcut.Arguments = '-windowstyle hidden -ExecutionPolicy RemoteSigned "Start-Process ssh root@192.168.1.1"'
$Shortcut.IconLocation = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe,0"
$Shortcut.WorkingDirectory = "."
$Shortcut.Save()

  • 強制的に貼り付け
  • yes

SSHログイン出来ない場合:exclamation:

known_hostsクリア

  • C:\Users\yourusername\.ssh\known_hosts ※Windows隠しファイル
powershell
Clear-Content .ssh\known_hosts -Force


OpenSSHのインストール
※Windows 10 Fall Creators Update(1709)以降標準搭載

  • 機能の確認
powershell
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'

  • 機能のインストール
powershell
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0


ルーターアドバタイズメントとDHCPv6

SLAAC と DHCPv6

uci set dhcp.lan.ra='server'
uci set dhcp.lan.dhcpv6='server'
uci add_list dhcp.lan.ra_flags='managed-config'
uci add_list dhcp.lan.ra_flags='other-config'
uci commit 
/etc/init.d/dnsmasq restart
/etc/init.d/odhcpd restart

SLAAC

Windows 10、Chrome OS、Android クライアントにはいくつかの問題があり、これらのデバイスにはリンクローカル IPv6 アドレスのみが割り当てられます。

uci set dhcp.lan.ra='server'
uci set dhcp.lan.dhcpv6='disabled'
uci set dhcp.lan.ra_flags='none'
uci commit 
/etc/init.d/dnsmasq restart
/etc/init.d/odhcpd restart

IPv6 の追加機能

デフォルトでIPv6を使用する

NET_ULA="$(uci get network.globals.ula_prefix)"
uci set network.globals.ula_prefix="d${NET_ULA:1}"
uci commit network
/etc/init.d/network restart

DHCPによるIPv6デフォルトルートの提供

GUA プレフィックスが欠落しているIPv6デフォルト ルート をアナウンスします。

uci set dhcp.lan.ra_default="1"
uci commit dhcp
/etc/init.d/odhcpd restart

ランダムIPv6アドレス

uci set network.lan.ip6ifaceid='random'
uci commit network
/etc/init.d/network reload

ネットワークデバイスのIPv6利用

LANポート確認

uci show network

参考

# lan1
uci add network device
uci set network.@device[-1].name='lan1'
uci set network.@device[-1].mtu='1500'
uci set network.@device[-1].ipv6='1'
uci set network.@device[-1].mtu6='1500'
# lan2
uci add network device
uci set network.@device[-1].name='lan2'
uci set network.@device[-1].mtu='1500'
uci set network.@device[-1].ipv6='1'
uci set network.@device[-1].mtu6='1500'
# lan3
uci add network device
uci set network.@device[-1].name='lan3'
uci set network.@device[-1].mtu='1500'
uci set network.@device[-1].ipv6='1'
uci set network.@device[-1].mtu6='1500'
# lan4
uci add network device
uci set network.@device[-1].name='lan4'
uci set network.@device[-1].mtu='1500'
uci set network.@device[-1].ipv6='1'
uci set network.@device[-1].mtu6='1500'
# set
uci commit network
/etc/init.d/network reload

1
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?