Skip to content

Add -M option for Fwmark - #746

Merged
ginuerzh merged 2 commits into
ginuerzh:masterfrom
purerosefallen:patch-mark
Apr 7, 2022
Merged

ginuerzh merged 2 commits into
ginuerzh:masterfrom
purerosefallen:patch-mark

Conversation

@purerosefallen

@purerosefallen purerosefallen commented Aug 13, 2021 •

Copy link
Copy Markdown
Contributor

Added an -M <mark> option to specify fwmark for outbound connections. It can also be set by config file.

{
    "Routes": [
        {
            "Retries": 3,
            "ServeNodes": [
                "quic://:443"
            ],
            "Mark": 1000
        }
    ]
}

@ginuerzh

Copy link
Copy Markdown
Owner

Could you explain the function of this option?

@purerosefallen

Copy link
Copy Markdown
Contributor Author

To specify the outgoing connection's mark, used by iptables or iproute2.
This is to make more custom routing rules. A quick example could be, after setting mark to 1000, we can set the following rule, making all outgoing traffic from a specific route of gost going to a specific gateway.

ip route add default via ppp1 table 1000
ip rule add pref 100 fwmark 1000 lookup 1000

@ginuerzh
ginuerzh merged commit 11d4838 into ginuerzh:master Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址