LoginSignup
0
0

More than 5 years have passed since last update.

Setting guest network: user-mode hostfwd

Last updated at Posted at 2014-11-13

hostfwd検証メモ

概要

Bridge Networkingを使わずに、User-mode hostfwdを使用してホストからゲストにSSHログインする。

ネットワーク構成

  • hostonly (host <-> guest)

作業内容

Host側

 -netdev user,id=hostonly0,net=10.2.0.0/8,host=10.2.0.2,dhcpstart=10.2.0.20,hostfwd=tcp:${hostfwd_addr}:${hostfwd_port}-:22 \
 -device ${nic_driver},netdev=hostonly0 \

Guest側

/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
TYPE=Ethernet
BOOTPROTO=dhcp
ONBOOT=yes

SSH using Port Forwarding

$ ssh localhost -p <hostfwd_addr>

これでゲスト内にSSHログイン可能。
なお、eth0のIPアドレスは、10.2.0.20となっているはずである。

 -netdev user,id=hostonly0,net=10.2.0.0/8,host=10.2.0.2,dhcpstart=10.2.0.20,hostfwd=tcp:${hostfwd_addr}:${hostfwd_port}-:22 \

net, host, dhcpstart の値で変更可能。

Links

0
0
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
0
0