What's new

VPN setup and forwarding RDP port through OpenVPN Client

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Well either the Selective fwmark port 465 tagging never works?, or if it does indeed (though suddenly cease to) correctly force emails out via the WAN, then you should provide detailed diagnostics to fully substantiate what you mean by "seems to get lost"

The Solution seems to be some delays.
#!/bin/sh

sleep 2

ip rule del fwmark 0x7000/0x7000 2> /dev/null
ip rule add fwmark 0x7000/0x7000 table 254 prio 9990
ip route flush cache

sleep 2

# Route secure email port to WAN and not VPN.
iptables -t mangle -D PREROUTING -i br0 -p tcp -m multiport --dport 465 -j MARK --set-mark 0x7000/0x7000 2> /dev/null
iptables -t mangle -A PREROUTING -i br0 -p tcp -m multiport --dport 465 -j MARK --set-mark 0x7000/0x7000

# Route RDP port through VPN tunnel
iptables -t mangle -D PREROUTING -i br0 --src 192.168.1.16 -p udp -m multiport --sport 3389 -j MARK --set-mark 0x7000/0x7000 2> /dev/null
iptables -t mangle -D PREROUTING -i br0 --src 192.168.1.16 -p tcp -m multiport --sport 3389 -j MARK --set-mark 0x7000/0x7000 2> /dev/null
iptables -t mangle -A PREROUTING -i br0 --src 192.168.1.16 -p udp -m multiport --sport 3389 -j MARK --set-mark 0x7000/0x7000
iptables -t mangle -A PREROUTING -i br0 --src 192.168.1.16 -p tcp -m multiport --sport 3389 -j MARK --set-mark 0x7000/0x7000
 
The Solution seems to be some delays.

I suspect that you could use a single 4 second delay at the start of the script rather two discrete 2 second delays, but not sure why the delay(s) are explicitly necessary in your environment - although having checked my nat-start script it does trundle through performing other junk before it adds my custom fwmark tagging stuff.:rolleyes:
Code:
# Route RDP port through VPN tunnel
P.S. Shouldn't the above be
Code:
# Route RDP port through WAN
;)
 
I suspect that you could use a single 4 second delay at the start of the script rather two discrete 2 second delays, but not sure why the delay(s) are explicitly necessary in your environment - although having checked my nat-start script it does trundle through performing other junk before it adds my custom fwmark tagging stuff.:rolleyes:

P.S. Shouldn't the above be
Code:
# Route RDP port through WAN
;)

Yep.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top