-
Notifications
You must be signed in to change notification settings - Fork 12
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
Lan client Route from ip address and port #40
Comments
I don't have the feature for port routing at the moment. I will look into it. Since you are using x3mRouting, you can use the instructions https://github.com/RMerl/asuswrt-merlin.ng/wiki/Policy-based-Port-routing-(manual-method) for port routing and place the iptables command in /jffs/scripts/x3mRouting/vpnclient1-route-up and /jffs/scripts/x3mRouting/vpnclient1-route-pre-down vpnclient1-route-up (have a -D entry to prevent duplicates before creating the rule) vpnclient1-route-pre-down |
The above assumes you have a rule already created using x3mRouting that uses the VPN iface so the fwmark gets created. |
Hmm, |
A little bit clarification for my previous question: will it work together with my preexisting rules? Currently my vpnclient1-route-up looks is: and vpnclient1-route-pre-down is: so if I add this newly created 2 lines
vpnclient1-route-pre-down is:
Will it break anything? |
Sorry for the delayed reply. I primarily monitor the x3mRouting support thread on snbforums rather than email.
I just started working to add port routing. Here is how you can use x3mRouting features to implement the solution.
http://www.snbforums.com/threads/x3mrouting-selective-routing-for-asuswrt-merlin-firmware-1-nov-2020.67388/post-630297 (http://www.snbforums.com/threads/x3mrouting-selective-routing-for-asuswrt-merlin-firmware-1-nov-2020.67388/post-630297)
November 1, 2020 5:07 AM, "Salvora" <[email protected] (mailto:[email protected]?to=%22Salvora%22%20<[email protected]>)> wrote:
A little bit clarification for my previous question:
If I add these rules to
vpnclient1-route-up
and
vpnclient1-route-pre-down
will it work together with my preexisting rules?
Currently my vpnclient1-route-up looks is:
#!/bin/sh
iptables -t mangle -D PREROUTING -i br0 -m set --match-set GULIBU dst -j MARK --set-mark 0x1000/0x1000 2>/dev/null
iptables -t mangle -A PREROUTING -i br0 -m set --match-set GULIBU dst -j MARK --set-mark 0x1000/0x1000
and vpnclient1-route-pre-down is:
#!/bin/sh
iptables -t mangle -D PREROUTING -i br0 -m set --match-set GULIBU dst -j MARK --set-mark 0x1000/0x1000 2>/dev/null
so if I add this newly created 2 lines
vpnclient1-route-up is:
#!/bin/sh iptables -t mangle -D PREROUTING -i br0 -m set --match-set GULIBU dst -j MARK --set-mark 0x1000/0x1000 2>/dev/null iptables -t mangle -A PREROUTING -i br0 -m set --match-set GULIBU dst -j MARK --set-mark 0x1000/0x1000 iptables -t mangle -D PREROUTING -i br0 -m iprange --src-range 192.168.1.41 -p tcp -m multiport --dport 54333,6881 -j MARK --set-mark 0x1000/0x1000 2> /dev/null iptables -t mangle -A PREROUTING -i br0 -m iprange --src-range 192.168.1.41 -p tcp -m multiport --dport 54333,6881 -j MARK --set-mark 0x1000/0x1000
vpnclient1-route-pre-down is:
#!/bin/sh iptables -t mangle -D PREROUTING -i br0 -m set --match-set GULIBU dst -j MARK --set-mark 0x1000/0x1000 2>/dev/null iptables -t mangle -D PREROUTING -i br0 -m iprange --src-range 192.168.1.41 -p tcp -m multiport --dport 54333,6881 -j MARK --set-mark 0x1000/0x1000 2> /dev/null
Will it break anything?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub (#40 (comment)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AGI3Y5GOIJUSF3V3CKJA23LSNSDDFANCNFSM4S4BES6A).[ { "@context": "http://schema.org (http://schema.org)", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "#40 (comment) (#40 (comment))", "url": "#40 (comment) (#40 (comment))", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com (https://github.com)" } } ]
--
This message has been scanned for viruses and
dangerous content by MailScanner (http://www.mailscanner.info/), and is
believed to be clean.
…--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
|
Love your script so far.
I know this can be done using iptables and manually arranging things but it is difficult this way so I am just curious;
Is there a way to specify the lan ip and port for routing using x3m?
I mean:
Route to VPNX, If a connection comes from Lan Client X with port XXXX?
I have a server that runs some specific applications using predefined ports. I don't want my whole server to be on VPN connections. Just those specific applications.
The text was updated successfully, but these errors were encountered: