web-dev-qa-db-ja.com

VirtualBox DHCPを変更して、10.0.x.xアドレスではなく192.168.x.xアドレスを発行しますか?

私はVirtualBox(v4.1.8)を持っていますVM DHCPを介して10.0.x.x範囲のIPが自動的に割り当てられます。

代わりに192.168.x.x範囲を使用するように変更できますか?

31
Boy Baukema

@RelaXNowのおかげで、ここに質問への答えがあります:

VBoxManage modifyvm  "NameOfVM" --natnet1 "192.168/16" 
23
cutrightjm

私が質問を理解したとすると、あなたがチェックした場合、マニュアルの 第6章 と書かれています:

In the VirtualBox graphical user interface, you can configure all these items in the global settings via "File" -> "Settings" -> "Network", which lists all Host-only networks which are presently in use. Click on the network name and then on the "Edit" button to the right, and you can modify the adapter and DHCP settings.

enter image description here

16
tombull89

はい、変更できます。ここにドキュメントがあります:

http://www.virtualbox.org/manual/ch08.html#vboxmanage-dhcpserver

VBoxManage dhcpserverコマンドで処理されます。

3
Coops

通常、VirtualBox DHCPアドレス範囲を変更する必要はありません。このネットワークは内部にあり、VMとVirtualBoxアプリケーションの間にのみ存在します。ルーティングは含まれず、NATのみが含まれます。

デフォルトのNAT=モードのままで、外部から仮想マシンへのアクセスを許可する場合は、ポートを選択的に開くことができます(ポート転送)。

たとえば、2022ポート経由で内部SSHサーバーへのアクセスを許可するには、次のコマンドを使用します。

VBoxManage modifyvm "NameOfVM" --natpf1 "guestssh,tcp,,2022,,22"
3
jlliagre