opensshをつかった簡易VPN (3) centosでやってみるですよ

(2)にてkvmホスト機としてbr0(bridge)がすでに存在しており、なにがないやら
すでによくわかりません!状態だったので、

綺麗なcentos(192.168.1.41(クライアント)、192.168.1.42(サーバ)でやってみる

証明書の交換はすでにすんでいるとし、
(サーバ)# /etc/ssh/sshd_configに PermitTunnel yesを設定してあるとする。

さてやってみよう!

[root@cent5-64b-41 ~]# ssh -v -w0:0 192.168.1.42
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 192.168.1.42 [192.168.1.42] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '192.168.1.42' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
Unknown code krb5 195

debug1: Unspecified GSS failure.  Minor code may provide more information
Unknown code krb5 195

debug1: Unspecified GSS failure.  Minor code may provide more information
Unknown code krb5 195

debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Requesting tun.
debug1: sys_tun_open: tun0 mode 1 fd 7
debug1: channel 1: new [tun]
debug1: Sending environment.
debug1: Sending env LANG = ja_JP.UTF-8
Last login: Wed May 11 21:00:48 2011 from cent5-64b-41.hirasawa.local
[root@cent5-64b-42 ~]# 
[root@cent5-64b-42 ~]# ip add
1: lo:  mtu 16436 qdisc noqueue 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 18:a9:05:55:2a:64 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.42/24 brd 192.168.1.255 scope global eth0
    inet6 2001:c90:ea4:3011:1aa9:5ff:fe55:2a64/64 scope global dynamic 
       valid_lft 2591896sec preferred_lft 604696sec
    inet6 fe80::1aa9:5ff:fe55:2a64/64 scope link 
       valid_lft forever preferred_lft forever
3: sit0:  mtu 1480 qdisc noop 
    link/sit 0.0.0.0 brd 0.0.0.0
4: tun0:  mtu 1500 qdisc noop qlen 500
    link/[65534] 
[root@cent5-64b-42 ~]# 

おお、今度はtun0が生えたw

でもでも、tun0の部分からわかるように、この状態はサーバとクライアントとのtun
バイス間に通信路が確立しただけです。