Skip to content

Problem with Routing Traffic to another WAN link changing Mark value.  #19

@samueljaydan

Description

@samueljaydan

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)
}



Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions