iqiyi / dpvs

DPVS is a high performance Layer-4 load balancer based on DPDK.
Other
3.04k stars 730 forks source link

启用2个 fullnat 模式规则的时候,配置同一个localip 只转先配置的?另外一个规则不转 #863

Closed jiangyibo closed 1 year ago

jiangyibo commented 1 year ago

[root@S0512 bin]# cat setup.sh

!/bin/sh

VIP=119.188.210.149 LIP=119.188.210.240 RS=119.188.210.128 ./dpip vlan add dpdk0.100 link dpdk0 id 100 ./dpip addr add ${VIP}/24 dev dpdk0.100 ./ipvsadm -A -t ${VIP}:8081 -s rr ./ipvsadm -a -t ${VIP}:8081 -r ${RS}:8082 -b

VIP=119.188.210.159 LIP=119.188.210.240 RS=119.188.210.128 ./dpip vlan add dpdk0.100 link dpdk0 id 100 ./dpip addr add ${VIP}/24 dev dpdk0.100 ./ipvsadm -A -t ${VIP}:8083 -s rr ./ipvsadm -a -t ${VIP}:8083 -r ${RS}:8083 -b

VIP 是2个 ,LIP是同一个,这样就只能通一个,可以两个都通的吗

ywc689 commented 1 year ago
  1. fullnat转发需要配置local IP,并配置 sapool (dpip addr add LIP/24 dev dpdk0.100 sapool)
    # ipvsadm --help| grep local
    ipvsadm -P|Q -t|u|q|f service-address -z local-address
    --add-laddr       -P        add local address
    --del-laddr       -Q        del local address
    --get-laddr       -G        get local address
  2. vip 建议配置成 /32的
a2888409 commented 1 year ago

@ywc689 可以使用同个localip进行多个端口的转发吗?

jesson1 commented 1 year ago

@a2888409 兄弟,你解决了吗

ywc689 commented 1 year ago

@ywc689 可以使用同个localip进行多个端口的转发吗?

支持。该问题是local IP没有正确配置