0

I have 2 Servers, 1 normal Server without ddos protection and 1 ddos protected v-Server,

i try to forward traffic through the v server to the main server. So if someone access to my v-server like tcp 80 or udp 9987 then it will redirect it to my server and the same vice versa...

so my plan is to make the v-server like an router ... vserver -> linux debian 7 main server -> windows 2012 r2

p.s. if possible ways without ssh

has anyone ideas ? thanks ahead

0

The easiest way might be setting up DNAT with iptables on v-Server.

iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination <main-server>
iptables -t nat -A PREROUTING -p udp --dport 9987 -j DNAT --to-destination <main-server>

# This is needed to correctly return response packets to hosts in the same subnet.
iptables -t nat -A POSTROUTING -m conntrack --ctstate DNAT -j SNAT --to-source <v-Server>

You should specify <main-server> or <v-Server> as IP addresses in the example above.

Alternatively it could be setting up LVS/DR with ipvsadm which seems a bit bloating.

For tcp/80 traffic you could also set up a proxy server using nginx or something like it.

  • The two iptables rules won't be enough if he wants to access the two ports of v-Server from the same subnet. SNAT is also required. – petry Jul 19 '15 at 8:48
  • i did not understand and i just will forward the hole traffic so all ports execpt ssh – ProJaCore Jul 19 '15 at 8:49
  • @petry Oh yeah I arbitrarily assumed v-Server is a default router for main-server. I updated my post. Thanks! – yaegashi Jul 19 '15 at 9:43
  • oh god what did i actually forgot ? its telling me everytime: " iptables v1.4.18: can't initialize iptables table `nat': Table does not exist (do you need to insmod?) " – ProJaCore Jul 19 '15 at 10:45
  • @ProJaCore Could you be more specific on your servers (distribution, hardware, virtualization, etc.) ? – yaegashi Jul 19 '15 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.