-
-
Notifications
You must be signed in to change notification settings - Fork 605
Configure a static IP address
OSv assigns IP address using DHCP by default, but there's a interface to configure IP address manually. There are three cmdline parameter:
--ip=<nic>,<ip>,<netmask>
--defaultgw=<ip>
--nameserver=<ip>
To use these parameters, you'll need to modify cmdline.
If you are using scripts/run.py for executing OSv VM, you can configure IP like this:
./scripts/run.py -n -e "--ip=eth0,10.0.0.2,255.255.255.0 \
--defaultgw=10.0.0.1 --nameserver=10.0.0.1 `cat build/release/cmdline`"
If you are not using ./scripts/run.py, but using VMware image instead, you can configure IP like this:
./scripts/imgedit.py setargs build/release/osv.vmdk \
"--ip=eth0,10.0.0.2,255.255.255.0 --defaultgw=10.0.0.1 --nameserver=10.0.0.1 \
`cat build/release/cmdline`"
If XEN is used as a hypervisor for OSv and ./scripts/run.py is not used, you can configure IP by following the steps outlined below. First you have to edit the build image file as following:
./scripts/imgedit.py setargs build/release.x64/usr.img \
"--ip=eth0,10.0.0.2,255.255.255.0 --defaultgw=10.0.0.1 --nameserver=10.0.0.1 \
`cat build/release/cmdline`"
Next you can convert the image file to the image format needed to be used on XEN for example:
./scripts/convert raw
Which converts the modified usr.img with an static IP address into the RAW image format.