From Fedora Project Wiki


Network tests for OpenVZ Linux Containers and Checkpoint/Restore In Userspace (CRIU)

Known issues, bug reports, etc
This testcase doesn't contain this information. Pass this test only after base testcase. It's contain all needed info. QA:Testcase_vzctl_base


  1. Open terminal
  2. Switch to root user: su -
  3. Prepare sysctl settings for network:
    1. sysctl -w net.ipv4.ip_forward=1
    2. sysctl -w net.ipv4.conf.em1.forwarding=1
    3. sysctl -w net.ipv4.conf.em1.proxy_arp=1

How to test

  1. Start container: vzctl start 101
  2. Add network interface in container: vzctl set 101 --netif_add em1
  3. Enable forwarding in virtual eth: sysctl -w net.ipv4.conf.veth101.1.forwarding=1
  4. Enable proxy_arp in virtual eth: sysctl -w net.ipv4.conf.veth101.1.proxy_arp=1
  5. Enter to container: vzctl enter 101
  6. Enable network intarface: ip link set em1 up
  7. Assign ip address to interface: ip addr add dev em1
  8. Add route for interface: ip route add default via dev em1
  9. Exit from container: logout
  10. Enable virtual net interface: ip link set veth101.1 up
  11. Add route for virtual net interface: ip route add dev veth101.1
  12. Enter to container: vzctl enter 101
  13. Test network: ping -c 3
  14. Exit from container: logout
  15. Stop container: vzctl stop 101

Expected Results

  • All steps completes without error
  • #13 step shows like this:
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=52 time=23.1 ms
64 bytes from icmp_seq=2 ttl=52 time=23.6 ms
64 bytes from icmp_seq=3 ttl=52 time=23.8 ms

--- ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 23.104/23.544/23.856/0.343 ms


In network tests I've used two IPs, em1 network interface. More details about them:

  • - free IP from my subnet
  • - default gw for my subnet
  • em1 - name for ethernet interface