I have 2 WAN links.
WAN1 => set mark 1
WAN2 => set mark 2
I see that it can do Load Balancing and shares the lines with a probability of 0.5. When I print packet.Mark, I see that requests are coming through 1 and 2. I want to set the Mark as 1 like in the code below and only direct traffic through WAN1. However, I can't achieve this as output. What is the mistake? Thanks for your answer.
func ReadPacketDataNFQUEUE(queueNum uint16){
nfq, err := netfilter.NewNFQueue(queueNum, 16384, netfilter.NF_DEFAULT_PACKET_SIZE)
if err != nil {
fmt.Println(err)
return
}
defer nfq.Close()
for packet := range nfq.GetPackets() {
mark:=uint32(packet.Mark)
mark = 1
packet.Mark = mark
packet.SetVerdictMark(netfilter.NF_ACCEPT,mark)
}