[Users] VE_ROUTE_SRC_DEV

Galia Lisovskaya mail-lists4shaggy_cat at shaggy-cat.ru
Thu Nov 13 07:40:40 EST 2008


Hi all,

I have quation for set subj on my:

=====================================
============= ovz-system:==============
[shaggycat at hn ~]$ uname -a
Linux hn.loc 2.6.18-92.1.1.el5.028stab057.2 #1 SMP Mon Jul 21 20:55:45
MSD 2008 i686 i686 i386 GNU/Linux
[shaggycat at hn ~]$ rpm -qa | grep vz | grep -v vztmpl
ovzkernel-2.6.18-92.1.1.el5.028stab057.2
vzrpm44-4.4.1-22.5
vzrpm43-python-4.3.3-7_nonptl.6
vzdump-1.0-2
ovzkernel-devel-2.6.18-92.1.1.el5.028stab057.2
vzctl-lib-3.0.22-1
vzctl-3.0.22-1
vzyum-2.4.0-11
vzrpm44-python-4.4.1-22.5
vzrpm43-4.3.3-7_nonptl.6
vzquota-3.0.11-1
vzpkg-2.7.0-18
[shaggycat at hn ~]$ cat /etc/redhat-release
CentOS release 5.2 (Final)
============= ovz-system:==============
======================================

This system hase default routing with Ehternet divice with external IP:

==================================
========Network and routing==========

[shaggycat at hn ~]$ ip r ls
10.0.10.7 dev venet0  scope link  src 10.0.5.10
10.0.10.6 dev venet0  scope link  src 10.0.5.10
10.0.9.44 dev venet0  scope link  src 10.0.5.10
10.0.10.5 dev venet0  scope link  src 10.0.5.10
10.0.9.12 dev venet0  scope link  src 10.0.5.10
10.0.7.8 dev venet0  scope link  src 10.0.5.10
10.0.10.3 dev venet0  scope link  src 10.0.5.10
10.0.9.10 dev venet0  scope link  src 10.0.5.10
10.0.10.2 dev venet0  scope link  src 10.0.5.10
10.0.10.33 dev venet0  scope link  src 10.0.5.10
10.0.7.4 dev venet0  scope link  src 10.0.5.10
10.0.7.6 dev venet0  scope link  src 10.0.5.10
xx.xx.xx.0/24 dev eth0  proto kernel  scope link  src xx.xx.xx.xx
10.0.5.0/24 dev eth1  proto kernel  scope link  src 10.0.5.10
169.254.0.0/16 dev venet0  scope link
default via xx.xx.xx.yy dev eth0


[shaggycat at hn ~]$ ifconfig
eth0      Link encap:Ethernet  HWaddr *******************
          inet addr:xx.xx.xx.xx  Bcast:xx.xx.xx..255  Mask:255.255.255.0
          inet6 addr: fe80::280:48ff:fe48:225f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:623 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3059 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:112392 (109.7 KiB)  TX bytes:335087 (327.2 KiB)
          Interrupt:209 Base address:0xe000

eth1      Link encap:Ethernet  HWaddr 00:0C:76:E4:75:14
          inet addr:10.0.5.10  Bcast:10.0.5.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:76ff:fee4:7514/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:37890 errors:0 dropped:0 overruns:0 frame:0
          TX packets:57334 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5223964 (4.9 MiB)  TX bytes:73950506 (70.5 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)

venet0    Link encap:UNSPEC  HWaddr
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:52289 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29946 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:70399674 (67.1 MiB)  TX bytes:1776390 (1.6 MiB)

======== Network and routing ==========
===================================

In config file I set:

=================================
============== vz.conf ============

[shaggycat at hn ~]$ cat /etc/vz/vz.conf | grep -A 1 -B 2 eth
# The name of the device whose ip address will be used as source ip for VE.
# By default automatically assigned.
VE_ROUTE_SRC_DEV="eth1"

# Controls which interfaces to send ARP requests and modify APR tables on.
NEIGHBOUR_DEVS="eth1"

[shaggycat at hn ~]$

============== vz.conf ============
=================================

Becouse in man pages is text:

=================================
============== vz(5) ==============
<...skip...>
 VE_ROUTE_SRC_DEV="device"
              This parameter specifies the network device name which
ip address will used for source ip. If on HN configured >
              1 network interfaces and needed to specify the source ip
address, set corresponding device. By default takes the
              first in network device list.

       NEIGHBOUR_DEVS[="detect"]
              Controls on which interfaces to  add/remove  ARP
records  for  a  VE  IP,  also  which  interfaces  to  use  to
              query/announce  ARP.  If this is set to detect, the
right network interface (the one which is in the same subnet
              as a VE IP) will be chosen automatically. Any other
value restores old (as of vzctl 3.0.19 or  older)  behavior,
              when all the possible interfaces were used.
<..skip...>
============== vz(5) ==============
=================================

I think,  NEIGHBOUR_DEVS did'nt need set, but, if NEIGHBOUR_DEVS has
"detect" value, troubles is too.

Troubles:

[shaggycat at lamp ~]$ netstat -atun
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address
     State
tcp        0      0 :::22                       :::*
     LISTEN
tcp        0      0 :::80                       :::*
     LISTEN
tcp        0      0 ::ffff:10.0.10.5:22
::ffff:xx.xx.xx.xx:41782      ESTABLISHED
[shaggycat at lamp ~]$

If i restart services vz, network, down and up interfaces, trafic, may
be, go from eth1 with internail IP.

Here xx.xx.xx.xx it's static external IP, and eth0 is external
interface with this IP adress.
This gateway of this ip and it's ethernet device is default route from
Hardware Node.

In this day, when external link down (thank you, my ISP ! ), I get
more troubles for routes from VPS servers, becouse all routes go
from external IP.
IP assigned from DHCP.

In  lines. what i post. I edited some adress, becouse:  Now i make
(after some restarts servises, see whrite before) route venet trafic
with eth1
I use copy-paste current configuration and my memory. My be, i make
error, when edit copy-paste text.

May I use VE_ROUTE_SRC_DEV, if it device != default route device? Or
it's bad idea?

Sorry for bad English.
Please help me for find erorr.
Thank you for all answer or ideas.

-- 
Best regards,
Galia Lisovskaya.
e-mail: inbox at shaggy-cat.ru


More information about the Users mailing list