Mahdi-zarei / nekoray

Qt based cross-platform GUI proxy configuration manager (backend: sing-box)
GNU General Public License v3.0
250 stars 17 forks source link

Routing discussion #45

Closed M-Sadegh-M closed 1 week ago

M-Sadegh-M commented 2 weeks ago

Hello Thank you for updating the program. Please add a wiki or tutorials for routing. I used this repo to bypass Iranian sites. Now, due to the change in the routing section, I don't know how to use routhing section.

Thank you

papampi commented 1 week ago

Use Chocolate4U Download geosite and geoip .db files and copy into nekoray folder. Restart nekoray so the db files get loaded.

In nekoray: "Routing Settings" > "Route" > double click Default > "New" > "Set Name", "Attribute: "rule_set" >>> Start typing rule names and it will be filtered in right pane, click on the rule you want and it will be added.

I think all the rest like domains, ip, .... are easy enough to figure out.

Mahdi-zarei commented 1 week ago

Use Chocolate4U Download geosite and geoip .db files and copy into nekoray folder. Restart nekoray so the db files get loaded.

this practically should be unnecessary as they are shipped with the package.

Please add a wiki or tutorials for routing.

I'm planning to do this, but either way for usages more complex than bypassing local IPs you will have to refer to sing-box's documentation as nekoray simply generates the rules and required assets and has no role in how they work.

papampi commented 1 week ago

Use Chocolate4U Download geosite and geoip .db files and copy into nekoray folder. Restart nekoray so the db files get loaded.

this practically should be unnecessary as they are shipped with the package.

If default added .db are from loyalsoldier or sing-box, they don't have complete Iran rules and miss a lot That's why I suggested using Chocolate4U Also noticed .dat files still exist in zip which has no use anymore.

M-Sadegh-M commented 1 week ago

I'm planning to do this

Thank you. Routing part needs to be simplified for normal users

I only needed the following code and it was hard to create it with tabs and windows

{ "outbound": "dns_out", "protocol": "dns" } ,{ "outbound": "direct", "rule_set": [ "ir_SITE" ] } ,{ "outbound": "direct", "rule_set": [ "ir_IP" ] } ,{ "outbound": "block", "rule_set": [ "category-ads-ir_SITE" ] }

It's very difficult to find rules in this section without search box. image

Mahdi-zarei commented 1 week ago

I'm planning to do this

Thank you. Routing part needs to be simplified for normal users It's very difficult to find rules in this section without search box. image

The right side text box is an auto complete section, you can type in the input box and it will show you suggestions which you can use, practically the input box could be considered a search box here.

papampi commented 1 week ago

It's very difficult to find rules in this section without search box.

Just start typing in middle pane and it filter out in right pane: Then click on filtered ones, and they will be added.

image

M-Sadegh-M commented 1 week ago

What's the different between "ir_site" and "category-ir_site"

papampi commented 1 week ago

What's the different between "ir_site" and "category-ir_site"

I think ir_site are all Iranian sites while category-ir are the Iran access only

M-Sadegh-M commented 1 week ago

Based on the discussions and developer plans, I consider this issue closed.

Thank you

M-Sadegh-M commented 1 week ago

Sorry to reopen this issue

I have another question : Which one of these is used for single IP or domain?

image

Mahdi-zarei commented 1 week ago

Sorry to reopen this issue

I have another question : Which one of these is used for single IP or domain?

image

For a single ip, ip_cidr can be used like 192.168.1.1/32. for a single domain, domain should be used with the desired domain as input.

papampi commented 1 week ago

Just make sure for domain+subdomains you should use domain_suffix if use domain sing-box only filter that domain and no subdomains.

M-Sadegh-M commented 1 week ago

for example image

but it's not working

image image

Mahdi-zarei commented 1 week ago

for example image

but it's not working

image image

Because you are not visiting google.com or youtube.com, but www.google.com and www.youtube.com. Those 2 are different domains.

M-Sadegh-M commented 1 week ago

Because you are not visiting google.com or youtube.com, but www.google.com and www.youtube.com. Those 2 are different domains.

yes it's worked. image

Now, if you don't mind, one more question

How to direct private ranges 10.10 and 172

Thanks a lot

papampi commented 1 week ago

but it's not working

image image

As @Mahdi-zarei said and I said earlier, www.example.com, abc.example.com, xyz.example.com, ... are subdomains of example.com. You should use domain_suffix to include all.

papampi commented 1 week ago

Because you are not visiting google.com or youtube.com, but www.google.com and www.youtube.com. Those 2 are different domains.

yes it's worked. image

Now, if you don't mind, one more question

How to direct private ranges 10.10 and 172

Thanks a lot

Use a cidr calculator like https://www.ipaddressguide.com/cidr then add the desired range to ip_cidr

M-Sadegh-M commented 1 week ago

thanks a lot

papampi commented 1 week ago

Or just add Private_ip and Private_site in a rule_set

image

papampi commented 1 week ago

@Mahdi-zarei I think this issue can be pinned until a tutorial gets ready.

M-Sadegh-M commented 1 week ago

@Mahdi-zarei I think this issue can be pinned until a tutorial gets ready.

me too It's a good Q&A for others with same questions

papampi commented 1 week ago

@Mahdi-zarei I just noticed there is a "ip_is_private" with "true" or "false" setting. Do you know if it work the same as ip_cidr or private-ip rule sets?

Mahdi-zarei commented 1 week ago

@Mahdi-zarei I just noticed there is a "ip_is_private" with "true" or "false" setting. Do you know if it work the same as ip_cidr or private-ip rule sets?

As far as I'm concerned it matches whether a destination IP is private, so I guess if the rule-set you are using is accurate it should have the same functionality, but since private IPs are predefined and do not change, the boolean flag should be a much better choice than rule sets. Also note that false does not match anything ( it does not mean ip is not private, it simply means the flag is non-existant if I'm not mistaken )

papampi commented 3 days ago

How to set process to bypass:

Preferences >> Routing setting >> Route >> Double click the rule you are using (Default, Bypass Iran, ... ) >> New Set name Attribute: process_name or process_path Set outbound to direct

Better move to as high as you want before getting blocked or ...

image