[PVE-User] [PATCH] venet and routing... again ;)
Patryk Benderz
Patryk.Benderz at esp.pl
Wed Dec 16 15:21:05 CET 2009
[cut]
> > 2) how to modify routing on venet ifaces for guest to keep it
> > permanent?
>
> On Debian Guests, just read the file /etc/network/interfaces - I will
> post the text here:
>
> # WARNING: Do not edit this file, your changes will be lost.
> # Please create/edit /etc/network/interfaces.head and /etc/network/interfaces.tail instead,
> # their contents will be inserted at the beginning and at the end
> # of this file, respectively.
Hi again,
unluckily putting post-up routing rules into /etc/interfaces.tail does
not work. If i do it this way i get correct routing table:
glpi:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.0.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 venet0
192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 venet0
10.251.224.0 0.0.0.0 255.255.255.0 U 0 0 0 venet0
192.168.48.0 0.0.0.0 255.255.255.0 U 0 0 0 venet0
0.0.0.0 192.0.2.1 0.0.0.0 UG 0 0 0 venet0
but cannot ping any host in these networks.
My attempts to fix this:
1) I had to delete /etc/interfaces.tail and make additional init script
which is started after all (including venet0:0, 0:1, etc) interfaces are
up and running. This works fine, although i am not 100% satisfied with
this solution, as it is not "native".
2) I have noticed, that /etc/interfaces.tail is inserted somewhere in
the middle of /etc/interfaces instead of at the end. It looks
like /etc/vz/dists/scripts/debian-add_ip.sh around line 64, adds
interfaces.tail, and after that /usr/lib/vzctl/scripts/vps_functions (or
other scripts) adds venet0:0,0:1, etc. entries at end
of /etc/interfaces.
Following this trace, i have moved "tail" section in debian-add_ip.sh
to add_ip() function. This attempt worked like a charm and now i am able
to reach all networks automatically after start/reboot of guest.
Additionally this fixes /etc/interfaces.tail to be added at the end
of /etc/interfaces as it should be done.
Anyone interested, please test patch supplied in attachment. It was
generated with:
# cd /etc/vz/dists/scripts
# diff -Naur debian-add_ip.sh debian-add_ip.sh_modified_tail_behavior > debian-add_ip.sh_modified_tail_behavior.diff
Procedure to make a backup and apply patch:
1)copy .diff to your pve host (not guest) to /etc/vz/dists/scripts/
2)ssh to your pve host
3)# cd /etc/vz/dists/scripts/
4)# patch -b < debian-add_ip.sh_modified_tail_behavior.diff
If tests are positive, should this be pushed to OpenVZ?
--
Patryk "LeadMan" Benderz
Linux Registered User #377521
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments
Email secured by Check Point
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debian-add_ip.sh_modified_tail_behavior.diff
Type: text/x-patch
Size: 532 bytes
Desc: not available
URL: <http://lists.proxmox.com/pipermail/pve-user/attachments/20091216/b7878dcb/attachment.bin>
More information about the pve-user
mailing list