J
J
juffinhalli2013-06-26 08:08:13
linux
juffinhalli, 2013-06-26 08:08:13

Port forwarding from a gateway with two providers - where to dig?

Good morning, hackers!

Given:
Gateway on Debian
1st provider - slow, but with white IP
2nd provider - fast, but gray IP
Task:
1. Distribute Internet over a fast channel - decided
2. Accept connections to white IP on port 22 - decided
3 Forward port 25 from white IP to server on LAN 192.168.6.10 - not working

My /etc/network/interfaces

Many thanks in advance.
Update: A server on the local network needs a fast link.
Update2: If you distribute the Internet over a slow channel (that is, make the second one the default gateway), then port forwarding works successfully. Problem in routing

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
merlin-vrn, 2013-06-26
@juffinhalli

Have you read my article habrahabr.ru/post/117620/ ?

J
joneleth, 2013-06-26
@joneleth

so you need iptables that you post interfaces.

P
Puma Thailand, 2013-06-26
@opium

configure the routes, your packet arrives on a white IP, and flies away from a gray one, and on the other side they cannot understand the packet was sent to one place, but comes from another.

A
alz, 2013-06-26
@alz

You will need iproute
In short:
1. Create two routing tables, one for each provider
2. Create rules (ip rule) to label packets according to these tables
3. Set the appropriate label for new incoming connections
4. All outgoing packets restore label

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question