Vyatta から VyOS への移行

Vyatta Core 6.3 で動かしていたルータを VyOS 1.0.4 に移行したので、その手順について。
だいたい 5 分ほどで終わります。

前半の OS イメージを入れ替える部分は、
Vyatta Core は VyOS になりました - JANOG (PDF) に。
Vyatta CORE 6.6R1 から VyOS 1.0.4 へ変更してみた - Soukaku's HENA-CHOKO Blog

まず、OS イメージの切り換え。VyOSの鍵を導入する。

vyatta@vyatta-0:~$ wget http://vyos.net/so3group_maintainers.key0
 --2014-09-04 20:56:17--  http://vyos.net/so3group_maintainers.key
Resolving vyos.net..., 2a03:ca80:8001:7677::9000
Connecting to vyos.net||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3125 (3.1K) [text/plain]
Saving to: `so3group_maintainers.key'

100%[======================================>] 3,125       --.-K/s   in 0s      

2014-09-04 20:56:18 (300 MB/s) - `so3group_maintainers.key' saved [3125/3125]

vyatta@vyatta-0:~$ sudo apt-key add so3group_maintainers.key

続いて VyOS のイメージをダウンロード&登録する。

vyatta@vyatta-0:~$ add system image http://mirror.vyos-users.jp/iso/release/1.0.4/vyos-1.0.4-amd64.iso
Trying to fetch ISO file from http://mirror.vyos-users.jp/iso/release/1.0.4/vyos-1.0.4-amd64.iso
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
00  223M  100  223M    0     0  10.2M      0  0:00:21  0:00:21 --:--:-- 21.0M
ISO download suceeded.
Checking for digital signature file...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   836  100   836    0     0  19652      0 --:--:-- --:--:-- --:--:-- 38000
Found it.  Checking digital signature...
gpg: directory `/root/.gnupg' created
gpg: new configuration file `/root/.gnupg/gpg.conf' created
gpg: WARNING: options in `/root/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: Signature made Tue Jun 17 01:43:07 2014 JST using RSA key ID A442E6E9
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: Good signature from "SO3 Group Maintainers "
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: DD5B B405 35E7 F6E3 4278  1ABF B744 E25A A442 E6E9
Digital signature is valid.
Checking MD5 checksums of files on the ISO image...OK.
What would you like to name this image? [1.0.4]: (そのままリターン)
OK.  This image will be named: 1.0.4
Installing "1.0.4" image.
Copying new release files...
Would you like to save the current configuration 
directory and config file? (Yes/No) [Yes]: (そのままリターン)
Copying current configuration...
Would you like to save the SSH host keys from your 
current configuration? (Yes/No) [Yes]: (そのままリターン)
Copying SSH keys...
Setting up grub configuration...


vyatta@vyatta-0:~$ reboot
Proceed with reboot? [confirm][y] (そのままリターン)
Broadcast message from root@vyatta-0 (pts/0) (Thu Sep  2 21:08:26 2014):

The system is going down for reboot NOW!^M

vyatta@vyatta-0:~$ Write failed: Broken pipe


再起動したのを見計らって再接続すると、 VyOS に切り替わっているので、

$ ssh -i vyatta_key vyatta@vyatta.example.com
Welcome to VyOS
Linux vyatta 3.3.8-1-amd64-vyatta #1 SMP Wed Oct 30 22:54:40 CET 2013 x86_64
Welcome to VyOS.
This system is open-source software. The exact distribution terms for 
each module comprising the full system are described in the individual 
files in /usr/share/doc/*/copyright.


vyatta@vyatta-0:~$ configure 
vyatta@vyatta-0# set system host-name vyos-0


vyatta@vyatta-0# set system package repository community distribution hydrogen
vyatta@vyatta-0# set system package repository community url http://packages.vyos.net/vyos

変更を確認して commit & save

vyatta@vyatta-0# show
 system {
     config-management {
         commit-revisions 20
     console {
         device ttyS0 {
             speed 9600
>    host-name vyos-0
     package {
         auto-sync 1
         repository community {
             components main
>            distribution hydrogen
>            url http://packages.vyos.net/vyos
vyatta@vyatta-0# commit
vyatta@vyatta-0# save