highlights

2019年9月27日金曜日

Virtualbox + vagrantでeth0のIP範囲を変更する

Virtualboxでvagrantを起動するとeth0に10.0.2.0/24のIP範囲が割当たります。
これを変更する方法を記します。

環境

Virtualbox 6.0.12 r133076 (Qt5.6.3)
vagrant 2.2.4
MacOSX Mojave 10.14.6

変更方法

Vagrantfileに下記の記述を追加します。(ipの範囲は任意で)
vb.customize ['modifyvm', :id, '--natnet1', '192.168.222.0/24']

こんな感じでしょうか。
config.vm.provider "virtualbox" do |vb|
    vb.memory = "2048"
    vb.customize ['modifyvm', :id, '--natnet1', '192.168.222.0/24']
end

結果

eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  
          inet addr:192.168.222.15  Bcast:192.168.222.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe5f:82b1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:886 errors:0 dropped:0 overruns:0 frame:0
          TX packets:639 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:107198 (107.1 KB)  TX bytes:113410 (113.4 KB)

参考

1 件のコメント:

  1. You may even see their faces and directly interact with them by way of messages. If you are a social gambler, then you would discover this characteristic to 메리트카지노 be beneficial. In this information, we will discuss everything want to|you should|you have to} find out about stay casinos.

    返信削除