LoginSignup
3
5

More than 5 years have passed since last update.

VyOSでIPv6 リンクローカルアドレスをGWに設定する

Last updated at Posted at 2016-07-09

さくらのクラウドでルーターを作成し、IPv6を有効にしてVyOSから接続しようとした時の話です。

NG1

さくらのクラウドでは、IPv6でのゲートウェイが常に fe80::1 になっている様子です。なので、このように設定したくなります。

vyos@vyos# set protocols static route6 ::0/0 next-hop fe80::1

ただ、こうやっても通信できるわけがなく、時間だけが失われていきます。

OK

vyos@vyos# set protocols static route6 ::0/0 next-hop fe80::1 interface 'eth0'

NG2

最初こういうことやってたけど、アホなやり方だったみたいです

fe80::1 これはローカルリンクアドレスです。ですので、インタフェースが特定できなければパケットを配信することが出来ません。ただ、VyOSの設定上ではルーティングにインタフェースを指定することが出来ないので(探した限り)、以下のファイルを編集します。

vyos@vyos# cat /opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script  
#!/bin/sh
# This script is called from /etc/rc.local on boot after the Vyatta
# configuration is fully applied. Any modifications done to work around
# unfixed bugs and implement enhancements which are not complete in the Vyatta
# system can be placed here.

ip -6 route add default via fe80::1 dev eth0
3
5
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
3
5