Add a Virtual Network to a vSRX Virtual Firewall VM with KVM
You can extend an existing vSRX Virtual Firewall VM to use additional virtual networks.
To create a virtual network with virt-manager
:
- Launch
virt-manager
and select Edit>Connection Details. The Connection details dialog box appears. - Select Virtual Networks. The list of existing virtual networks appears.
- Click + to create a new virtual network for the control link. The Create a new virtual network wizard appears.
- Set the subnet for this virtual network and click Forward.
- Optionally, select Enable DHCP and click Forward.
- Select the network type from the list and click Forward.
- Verify the settings and click Finish to create the virtual network.
To create a virtual network with virsh
:
Use the
virsh net-define
command on the host OS to create an XML file that defines the new virtual network. Include the XML fields described in Table 1 to define this network.Note:See the official
virsh
documentation for a complete description of available options, including how to configure IPv6 networks.Table 1: virsh net-define XML Fields Field
Description
<network>...</network>
Use this XML wrapper element to define a virtual network.
<name>net-name</name>
Specify the virtual network name.
<bridge name=”bridge-name” />
Specify the name of the host bridge used for this virtual network.
<forward mode=”forward-option” />
Specify routed or nat. Do not use the <forward> element for isolated mode.
<ip address=”ip-address” netmask=”net-mask”
<dhcp range start=”start” end=”end” </dhcp> </ip>
Specify the IP address and subnet mask used by this virtual network, along with the DHCP address range.
The following example shows a sample XML file that defines a new virtual network.
<network> <name>mgmt</name> <bridge name=”vbr1” /> <forward mode=”nat” /> <ip address=”10.10.10.1” netmask=”255.255.255.0” > <dhcp> <range start=”10.10.10.2” end=”10.10.10.99” /> </dhcp> </ip> </network>
Use the
virsh net-start
command in the host OS to start the new virtual network.hostOS# virsh net-start mgmt
Use the
virsh net-autostart
command in the host OS to automatically start the new virtual network when the host OS boots.hostOS# virsh net-autostart mgmt
Optionally, use the
virsh net-list –all
command in the host OS to verify the new virtual network.HostOS# # virsh net-list --all Name State Autostart Persistent ---------------------------------------------------------- mgmt active yes yes default active yes yes