diff --git a/scripts/start_qemu_vm.sh b/scripts/start_qemu_vm.sh index e0694b1..ecbddb8 100755 --- a/scripts/start_qemu_vm.sh +++ b/scripts/start_qemu_vm.sh @@ -30,8 +30,8 @@ add_nft_rules() { # TODO: This will handle only one IP per VM. If you add multiple IPs, fix this. # Also, we wish you good luck. We know this code is complicated. We tried, ok? - ipv4_addr=$(echo $PARAMS | grep -m 1 -oE "detee_net_eth${nic_index}=[0-9]{1,3}\.[0-9a-f\.]+" | cut -d "=" -f2 ) - ipv6_addr=$(echo $PARAMS | grep -m 1 -oE "detee_net_eth${nic_index}=[0-9a-f]{1,4}\:[0-9a-f\:]+" | cut -d "=" -f2 ) + ipv4_addr=$(echo $PARAMS | grep -m 1 -oP "detee_net_eth${nic_index}=[0-9]{1,3}\.[0-9a-f\.]+" | cut -d "=" -f2 ) + ipv6_addr=$(echo $PARAMS | grep -m 1 -oP "detee_net_eth${nic_index}=[0-9a-f]{1,4}\:[0-9a-f\:]+" | cut -d "=" -f2 ) [[ -n "$ipv4_addr" ]] && { nft add rule netdev deteemacvtap ${ifname}_in ip daddr != $ipv4_addr drop