以前ブログに書いたように、自宅のルータはVyatta(KVM上のVM)を使っています。
先日そのバージョンを6.5にアップしようとしたのですが、うまくいかずに切り戻すことになったのでその時のメモを。
移行前後のバージョンはこんな感じ。
移行前のバージョン
Version: VC6.3-2011.07.21 Description: Vyatta Core 6.3 2011.07.21 Copyright: 2006-2011 Vyatta, Inc. Built by: autobuild@vyatta.com Built on: Thu Jul 21 06:05:47 UTC 2011 Build ID: 1107210607-a17b235
移行後のバージョン
Version: VC6.5R1 Description: Vyatta Core 6.5 R1 Copyright: 2006-2012 Vyatta, Inc. Built by: autobuild@vyatta.com Built on: Fri Nov 16 16:39:16 UTC 2012 Build ID: 1211161646-334fb58
インストールに関しては、ディスクインストールのコマンドがちょっと変わってたくらいで特に困ることはありませんでした。
・6.3 $ install-image ・6.5 $ install image
コンフィグはけっこう変わっていたので、公式のドキュメントを見ながら書き換えです。
移行前のコンフィグ
interfaces {
ethernet eth0 {
address 192.168.1.1/24
}
ethernet eth1 {
pppoe 1 {
default-route auto
mtu 1454
name-server auto
password ****************
user-id XXXXX@XXXXX
}
}
}
service {
nat {
rule 10 {
outbound-interface pppoe1
source {
address 192.168.1.0/24
}
type masquerade
}
rule 100 {
destination {
port 80
}
inbound-interface pppoe1
inside-address {
address 192.168.1.111
}
protocol tcp
type destination
}
rule 110 {
destination {
port 22222
}
inbound-interface pppoe1
inside-address {
address 192.168.1.11
port 22
}
protocol tcp
type destination
}
}
ssh {
listen-address 192.168.1.1
port 22
protocol-version v2
}
}
system {
host-name vyatta01
time-zone Asia/Tokyo
}
移行後のコンフィグ
interfaces {
ethernet eth0 {
address 192.168.1.1/24
}
ethernet eth1 {
pppoe 1 {
default-route auto
mtu 1454
name-server auto
password ****************
user-id XXXXX@XXXXX
}
}
}
nat {
destination {
rule 100 {
destination {
port http
}
inbound-interface pppoe1
protocol tcp
translation {
address 192.168.1.111
}
}
rule 110 {
destination {
port 22222
}
inbound-interface pppoe1
protocol tcp
translation {
address 192.168.1.11
port 22
}
}
}
source {
rule 10 {
outbound-interface pppoe1
source {
address 192.168.1.0/24
}
translation {
address masquerade
}
}
}
}
service {
ssh {
listen-address 192.168.1.1
port 22
}
}
system {
host-name vyatta02
time-zone Asia/Tokyo
}特にNAT周りで、かなり書き方が変わってました。
※重要じゃないデフォルト設定は省略しています。いいかげんFireWallの設定やらないと・・・
そして既存ルータをshutdownして、新規ルータのコンフィグをcommit、
疎通やNATをひと通り確認、
特に問題なし!!!
。。。と思いきや・・・
あれ、なんかTwitterの表示がおかしい・・・
HTMLはGETできてるけど、CSSがとれてない・・・

いくつかのページで、ping疎通は問題ないけどHTTPのGETができない、という状態になってました。
[mikeda@test01 ~]$ ping -n si0.twimg.com PING cs107.wac.edgecastcdn.net (68.232.44.139) 56(84) bytes of data. 64 bytes from 68.232.44.139: icmp_seq=1 ttl=53 time=4.39 ms 64 bytes from 68.232.44.139: icmp_seq=2 ttl=53 time=4.40 ms 64 bytes from 68.232.44.139: icmp_seq=3 ttl=53 time=3.95 ms 64 bytes from 68.232.44.139: icmp_seq=4 ttl=53 time=4.50 ms 64 bytes from 68.232.44.139: icmp_seq=5 ttl=53 time=4.45 ms ... [mikeda@test01 ~]$ curl https://si0.twimg.com/a/1355419703/t1/css/t1_core.bundle.css 沈黙
straceやtcpdumpで確認したところ、コネクション張ってリクエスト出すところまではいってるのですが、レスポンスが受信できてません。
[mikeda@test01 tmp]$ strace wget https://si0.twimg.com/a/1355419703/t1/css/t1_core.bundle.css
…
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("68.232.44.139")}, 16) = 0
write(2, "\346\216\245\347\266\232\343\201\227\343\201\276\343\201\227\343\201\237\343\200\202\n", 22接続しました。
) = 22
gettimeofday({1355758206, 249904}, NULL) = 0
gettimeofday({1355758206, 249961}, NULL) = 0
write(3, "\26\3\1\0l\1\0\0h\3\1P\317:~GHB=<Z\307\322\214\311\330\251H\320\21\0054"..., 113) = 113
read(3, どうもエンド間でPPPoE用のMTUの調整がうまくいってないようです。
クライアント側で明示的に設定してやるといけのですが、
[root@test01 tmp]# ifconfig eth0 mtu 1454
[root@test01 tmp]# curl https://si0.twimg.com/a/1355419703/t1/css/t1_core.bundle.css
.btn{position:relative;display:inline-block;overflow:visible;padding…..デフォルトの1500だとレスポンスパケットが帰って来ません。
[root@test01 tmp]# ifconfig eth0 mtu 1500 [root@test01 tmp]# curl https://si0.twimg.com/a/1355419703/t1/css/t1_core.bundle.css 沈黙
しばらくいろいろ試したのですがけっきょく解決方法が見つからず、全クライアント機器でMTUを調整するのは難しいので切り戻しました。
うーん、何がダメなんだろう・・・何か設定が足りないんだろうけど・・・
追記
これが正しい方法なのかはわからないけど、LAN側インタフェースのポリシールートでMTU調整してやると通信できるようになった
set policy route PPPOE-IN rule 10 protocol 'tcp' set policy route PPPOE-IN rule 10 set tcp-mss '1414' set policy route PPPOE-IN rule 10 tcp flags 'SYN' set interfaces ethernet eth0 policy route 'PPPOE-IN'