Search

Language:  
Search for:

Available article translations:

Customizing network interface configuration in Debian/Ubuntu containers/VMs

Article ID: 115638, created on Mar 4, 2013, last review on May 11, 2014

APPLIES TO:
  • Virtuozzo
  • Virtuozzo containers for Linux
  • Virtuozzo hypervisor

Symptoms

Custom network interface settings specified in  /etc/network/interfaces are not applied in Debian-based containers or virtual machines.

Cause

Interface configuration in the file /etc/network/interfaces is automatically generated and all customizations are overwritten.
 
In virtual machines, the file is generated by Parallels Tools.
 
In containers, it is generated by scripts /etc/sysconfig/vz-scripts/dists/scripts/debian-add_ip.sh in routed mode and /etc/sysconfig/vz-scripts/dists/scripts/debian-add_netif.sh in bridged mode.

Resolution

To have those custom settings applied upon the interface's activation, the separate interface initialization script should be defined instead.

1. Create /etc/network/if-up.d/additional and specify custom settings there.

Example:
[root@debian.ct ~]# cat /etc/network/if-up.d/additional
#!/bin/bash -x
[ "$MODE" = "stop" -o -z "$MODE" ] && exit 0
case "$IFACE" in
eth0) ## custom commands for eth0
      ip route add mm.nn.245.0/24 via xx.yy.19.2 dev eth0
      ;;
esac
exit 0
[root@debian.ct ~]#

2. Set correct permissions on the script:
chmod 755 /etc/network/if-up.d/additional



a26b38f94253cdfbf1028d72cf3a498b 2897d76d56d2010f4e3a28f864d69223 d02f9caf3e11b191a38179103495106f 0dd5b9380c7d4884d77587f3eb0fa8ef e8e50b42231236b82df27684e7ec0beb

FEEDBACK
Was this article helpful?
Tell us how we may improve it.
Yes No
 
 
 
 
 
 
Server Virtualization
- Odin Cloud Server
- Odin Containers for Windows 6.0
- Odin Virtuozzo Containers
Automation
- Odin Automation
- Odin Automation for Cloud Infrastructure
- Odin Business Automation Standard
- Odin Virtual Automation
- Odin Plesk Panel Suite
- Web Presence Builder
- Odin Plesk Automation
- Odin Small Business Panel
- Value-added Services for Hosters
- Odin Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification