Skip to contentSkip to conversation

New: vrf fwmark socket

Bug 207401 Stephen Hemminger 1 participant 1 message Apr 22, 2020 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Looks like user error, not a bug.

Quoted 39 lines · On Wed, 22 Apr 2020 12:37:04 +0000 [email protected] wrote:

https://bugzilla.kernel.org/show_bug.cgi?id=207401

            Bug ID: 207401
           Summary: vrf fwmark socket
           Product: Networking
           Version: 2.5
    Kernel Version: 5.5.11
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: IPV4
          Assignee: [email protected]
          Reporter: [email protected]
        Regression: No

add rule:
#ip ru a fwmark 10000 table 10000 pref 900

and then add vrf and salve interface
#ip link add vrf-1 type vrf table 10
#ip link set dev vrf-1 up
#ip link set dev ens19 master vrf-1

write a program socket bind mark 10000 to match the rule setsockopt(entry->fd, SOL_SOCKET, SO_MARK, &mark, sizeof(mark));

add ip and add route in table 10000

# ip a a 5.5.5.5/24 dev ens20
# ip r a 5.5.5.0/24 dev ens20 scope link table 10000 
if I set src addr, then can't add this route 

visit the server,success
#curl --interface 5.5.5.100
but if I use the mark, my program can't visit the server kernel can't find my socket? return RST!