openelb icon indicating copy to clipboard operation
openelb copied to clipboard

Incomplete eip verification in layer2 or vip mode

Open renyunkang opened this issue 2 years ago • 0 comments

When the eip configured in layer2 or vip mode and the specified NIC are not in the same network segment, an error should be reported instead of being created successfully.

root@node1:~/openelb# ip a | grep eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    inet 172.16.1.2/24 brd 172.16.1.255 scope global dynamic noprefixroute eth0
apiVersion: network.kubesphere.io/v1alpha2
kind: Eip
metadata:
  name: layer-eip
spec:
  address: 172.16.1.100-172.16.1.200
  interface: eth0
  protocol: layer2

When the address is set to the network segment 172.16.1.0/24, the creation is successful.

apiVersion: network.kubesphere.io/v1alpha2
kind: Eip
metadata:
  name: layer-eip
spec:
  address: 172.16.2.100-172.16.2.200
  interface: eth0
  protocol: layer2

When the address is set to the network segment 172.16.2.0/24, the creation should fail. /kind bug

renyunkang avatar May 20 '22 07:05 renyunkang