It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
Howdy, Stranger!
It looks like you've been lurking for a while.
If you register, we also will remember what you have read and notify you about new comments. You will also be able to participate in discussions.
So if you'd like to get involved, register for an account, it'll only take you a minute!
ip r a PC-IP/32 dev venet0
ip r a PC-IP/32 via 169.254.0.1
sysctl -w net.ipv4.conf.venet0.rp_filter=0* Create iptables rules:
iptables -A OUTPUT -t mangle -p tcp -m tcp --sport 22 -j MARK --set-xmark 3
ip rule add fwmark 3 table 3
ip r a default dev venet0 table 3
iptables -A OUTPUT -t mangle -p tcp -m tcp --sport 22 -j MARK --set-xmark 3Note: When creating these rules, you can change the 22 port to, for example, 80 or 443 port. Then other services of your first server will be accesible from outside.
ip rule add fwmark 3 table 3
ip r a default via 169.254.0.1 dev eth0 table 3
iptables -A PREROUTING -p tcp --dport 22 -t mangle -j MARK --set-mark 3
iptables -A POSTROUTING -t nat -m mark --mark 3 -j SNAT --to-source SERVER1-IP
ip rule add fwmark 3 table 3
ip r a default dev venet0 table 3
Comments
https://www.ivacy.com/