Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two outgoing connections, pointing to different ISPs, on a gateway, in front of small-ish LAN.

IPs addresses are as follows:

ISP 1:

  • network: 10.1.1.0/24
  • gateway ip: 10.1.1.1
  • client ip: 10.1.1.2 (eth1)

ISP 2:

  • network: 10.2.1.0/24
  • gateway ip: 10.2.1.1
  • client ip: 10.2.1.2 (eth2)

LAN:

  • network: 192.168.0.0/24
  • gateway ip: 192.168.0.1 (eth0)

Few LAN clients, with IPs in range 192.168.0.128/25.

So, essentially, gateway has IPs 10.1.1.2, 10.2.1.2, and 192.168.0.1 on 3 NICs.

Default route on gateway is set to 10.1.1.1 dev eth1.

Right now, I have one routing table consisting of following entries, named isp2:

  • network 192.168.0.0/24 dev eth0
  • network 10.2.1.0/24 dev eth2
  • default route 10.2.1.1 dev eth2

I use that isp2 in MANGLE rules to redirect some traffic to utilize second outgoing link.

Everything works fine, when I want to redirect traffic that goes OUT, if it will go over primary ISP or over secondary ISP, based on MANGLE table rules.

Question: How do I configure gateway so it would allow inbound connections from second ISP, to be forwarded to clients in LAN, behind gateway? I want to forward traffic incoming on specific ports to specific port of specific clients, but it has to work over non-default route.

Any ideas?

Platform that I use is irrelevant, I'm more interested what needs to be done in order for this to work, but you can write examples as if I were using linux (so iproute2/iptables).

share|improve this question
    
You want some machines on your LAN to be reachable from the ISP2 WAN? Do those machines have public ip addresses? NAT perhaps? –  d-_-b Jul 8 '10 at 17:06
    
@sims: no. they don't have public IPs, they are NATed. I forgot to mention that. –  mr.b Jul 9 '10 at 2:25
    
So you want some machines, say an ftp server, to be accessible from the "internet" via the secondary WAN (your secondary ISP provider)? –  d-_-b Jul 9 '10 at 5:06
    
@sims: Yes, that would be a good example. –  mr.b Jul 10 '10 at 11:57
add comment

1 Answer

up vote 0 down vote accepted

You may use rinetd.

For FTP forwarding via ISP2, while ISP1 is the default one.

oneliner config:

10.2.1.2:21 192.168.1.129:21

the downside: on your FTP log, all connections will appear as coming from 10.2.1.2

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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