network traffic from wrong interface

dignus

Renowned Member
Feb 12, 2009
169
16
83
Hi all,

I have 2 proxmox hosts with 2 openvz containers on it. Both the proxmox hosts have 2 NIC's - external & internal lan with default GW on external LAN.

Both the VE's have 2 venet interfaces - external and internal lan. The weird thing is that when I try to connect from one ve1 to the ve2's internal LAN IP, the source address is always ve1's external IP. For example with MySQL:

web1:/# mysql -u root -h 192.168.1.248
ERROR 1045 (28000): Access denied for user 'root'@'ext.ext.ext.ip' (using password: NO)

Is this default behaviour? We're now seeing a LOT of traffic over the external interfaces which costs my client money :) Thanks in advance!
 
Openvz has one setting for that (man vz.conf):
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.

but setting that to the internal interface is maybe a bad idea - depends on your needs.