Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -M option for Fwmark #746

Merged
merged 2 commits into from
Apr 7, 2022
Merged

Conversation

purerosefallen
Copy link
Contributor

@purerosefallen purerosefallen commented Aug 13, 2021

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
Owner

Could you explain the function of this option?

@purerosefallen
Copy link
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