Handle ip from inside VE [message #22121] |
Sun, 21 October 2007 16:18 |
dagr
Messages: 83 Registered: February 2006
|
Member |
|
|
Is there a way to add and remove VE ip from inside VE ? (may be there is special vzctl capability)
|
|
|
|
Re: Handle ip from inside VE [message #22136 is a reply to message #22132] |
Mon, 22 October 2007 07:59 |
dagr
Messages: 83 Registered: February 2006
|
Member |
|
|
i checked http://wiki.openvz.org/Virtual_Ethernet_device#Making_a_veth -device_persistent
And found out problem - to make IP work i need to run on HN
ip route add 192.168.0.101 dev veth101.0
And when i move this IP to another VPS - i will need to change routes on HNs.
My goal is to exclude any need to make changes on HN side.
Lets say i have 2 VEs with db and standby: A and B . Each has main ip - ip_A and ip_B.
And also they have migrating production IP (for switchover).
What i want if to be able to migrate prod_ip from A to B and back running commands from inside VEs. (without any access to HNs ssh or else, though VEs have access to each other). Is it possible ?
P.S - Actually changing routes isnt necessary if there are no clients on same HNs which need communicate to prod_ip. In this case it would be possible just to make ifdown/ifup eth0:1 inside VEs. Still i found out problem with arp announce during ifup. I can see it via tcpdump inside VE but not on HN interface. Ie clients cant refresh their arp cache.
i have
/proc/sys/net/ipv4/conf/eth0/proxy_arp
/proc/sys/net/ipv4/conf/eth0/forwarding
/proc/sys/net/ipv4/conf/vethX/proxy_arp
/proc/sys/net/ipv4/conf/vethX/forwarding
set to 1.
I also tried to set
/proc/sys/net/ipv4/conf/.../arp_announce to 1 - but no result.
How do i make HN to retransmit arp announce ?
[Updated on: Mon, 22 October 2007 09:37] Report message to a moderator
|
|
|
|
|
Re: Handle ip from inside VE [message #22165 is a reply to message #22139] |
Mon, 22 October 2007 17:58 |
piavlo
Messages: 159 Registered: January 2007
|
Senior Member |
|
|
http://en.wikipedia.org/wiki/Proxy_ARP
If it might help , this is my network configuration for bridge:
projsrv1 ~ # cat /etc/vz/vznet.conf
#!/bin/bash
EXTERNAL_SCRIPT="/etc/vz/bin/vzbridge.add"
projsrv1 ~ # cat /etc/vz/bin/vzbridge.add
#!/bin/bash
CONFIGFILE=/etc/vz/conf/$VEID.conf
. $CONFIGFILE
VZHOSTIF=`echo $NETIF |sed 's/^.*host_ifname=\(.*\),.*$/\1/g'`
BRIDGED_VES_REGEXP='(101|102|103)'
echo "$VEID" | egrep -e "$BRIDGED_VES_REGEXP" > /dev/null
if [ "$?" == "0" ]; then
if [ ! -n "$VZHOSTIF" ]; then
echo "According to $CONFIGFILE VE$VEID has no veth interface configured."
exit 1
fi
ifconfig veth${VEID}.0 0
brctl addif br0 veth${VEID}.0
exit $?
fi
exit 0
projsrv1 ~ #
The eth0 is enslaved to br0
[Updated on: Mon, 22 October 2007 18:00] Report message to a moderator
|
|
|