Hi,

I am trying to test vpp load balance for my scenario. I create two pairs of 
veth on host linux, and connect vpp and two Nginx containers by them. A 
physical NIC is used by VPP as eth0 , and I create a loopback interface 
(loop0), finally I add the two host-interfaces and the loopback interface in 
the same bridge domain. the network toplogic is just like this picture. I can 
ping vpp eth0 within container. I hope the traffic from external can reach the 
nginx containers.

Then I would like to enable the vpp load balance feature, the configuration is 
like this:

set interface state eth0 up

set interface mtu 1500 eth0

set interface ip address eth0 10.161.30.5/24

ip route add 0.0.0.0/0 via 10.161.30.1

create host-interface name vpp1host
create host-interface name vpp2host

set interface state host-vpp1host up
set interface state host-vpp2host up

create loopback interface
set interface state loop0 up

set interface mtu 1500  host-vpp1host
set interface mtu 1500  host-vpp2host
set interface mtu 1500  loop0

create bridge-domain 1
set interface l2 bridge host-vpp1host 1
set interface l2 bridge host-vpp2host 1
set interface l2 bridge loop0 1 bvi

set interface ip address loop0 2.2.2.1/24

lb conf ip4-src-address 2.2.2.1
lb vip 10.161.30.5/32 protocol tcp port 80 encap nat4 type clusterip 
target_port 80
lb as 10.161.30.5/32 protocol tcp port 80 2.2.2.10 2.2.2.20
lb set interface nat4 in loop0  (after I add this configuration, the loop0 
interface can not reach container).

DBGvpp# show lb vips verbose

ip4-nat4 [1] 10.161.30.5/32

new_size:1024

protocol:6 port:80

type:clusterip port:20480 target_port:80  counters:

packet from existing sessions: 0

first session packet: 0

untracked packet: 0

no server configured: 0

#as:2

2.2.2.20 512 buckets   0 flows  dpo:18 used

2.2.2.10 512 buckets   0 flows  dpo:17 used

-----------------------------------------------------------------------------------------------------------------------------------------------

By the way,I also tried nat44 static mapping, and it works.

nat44 add address 10.161.30.5
set interface nat44 in loop0 out eth0
nat44 add load-balancing static mapping protocol tcp external 10.161.30.5:80 
local 2.2.2.10:80 probability 50 local 2.2.2.20:80 probability 50

So ,  can any one check where is the problem?
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15835): https://lists.fd.io/g/vpp-dev/message/15835
Mute This Topic: https://lists.fd.io/mt/72464203/21656
Mute #lb: https://lists.fd.io/mk?hashtag=lb&subid=1480452
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to