Search

Language:  
Search for:

Available article translations:

How to create a container attached to two different networks

APPLIES TO:
  • Parallels Cloud Server
  • Parallels Virtuozzo Containers for Linux
  • Parallels Server

Symptoms

This article explains how to assign a container with two NICs attached to different networks.

This configuration is required in cases where a container needs to have separate private and public network access with appropriate routing rules, e.g., when FrontNet is used for external access and BackNet is used for internal traffic.

Resolution

The example below illustrates how to connect a container to bridged FrontNet and BackNet networks:

  1. Create two bridged networks:

    ~# vznetcfg net new FrontNet
    ~# vznetcfg net new BackNet
    
  2. Find out which hardware NIC corresponds to which network:

    ~# ip a l
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
            valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
        link/ether 48:5b:39:19:6d:66 brd ff:ff:ff:ff:ff:ff
        inet 192.168.30.40/24 brd 192.168.30.255 scope global eth0
            valid_lft forever preferred_lft forever
    3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
        link/ether 48:5b:39:19:6d:68 brd ff:ff:ff:ff:ff:ff
        inet 100.200.30.40/24 brd 100.200.30.255 scope global eth1
            valid_lft forever preferred_lft forever
    
  3. Assign network interfaces to the virtual networks:

    ~# vznetcfg net addif FrontNet eth1
    ~# vznetcfg net addif BackNet eth0
    
  4. Add two network interfaces to the container:

    ~# vzctl set CTID --save --netif_add eth0
    ~# vzctl set CTID --save --netif_add eth1
    
  5. Assign them to the corresponding networks and configure the virtual adapters:

    ~# vzctl set CTID --save --ifname eth0 --network BackNet --ipadd 192.168.30.41/24 --gw 192.168.30.1
    ~# vzctl set CTID --save --ifname eth1 --network FrontNet --ipadd 100.200.30.41/24
    

NOTE: The "--gw" option specifies the default gateway setting, therefore it should be set only for one adapter. Set the most preferable route according to your needs.

For more information, refer to Parallels Virtuozzo Containers User's Guide, pages 210-238.

Search words:

bridged

two adapters

pcs: networking

Virtual network




eb0ea3b827d18de2329b6477e24c1d59 909d99074e442b52ce54cc7b31cf065d 2897d76d56d2010f4e3a28f864d69223 bf1c3a170005eae151f49ba2720abde9 ca05eaf5b843fbd53589c90d7228a6df

FEEDBACK
Was this article helpful?
Tell us how we may improve it.
Yes No
 
 
 
 
 
 
Desktop Virtualization
- Parallels Desktop 9 for Mac
- Parallels Transporter
- Parallels Desktop Switch to Mac Edition
- Parallels Desktop for Mac Enterprise Edition
- Parallels Management-Mac for Microsoft SCCM
Server Virtualization
- Parallels Cloud Server
- Parallels Containers for Windows 6.0 Beta
- Parallels Virtuozzo Containers
Automation
- Parallels Automation
- Parallels Automation for Cloud Infrastructure
- Parallels Business Automation Standard
- Parallels Virtual Automation
- Parallels Plesk Panel Suite
- Web Presence Builder
- Parallels Plesk Automation
- Parallels Small Business Panel
- Value-added Services for Hosters
- Parallels Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification