The pfSense Store

Author Topic: Multiple connection to different servers using the same port number  (Read 1730 times)

0 Members and 1 Guest are viewing this topic.

Offline lampie

  • Newbie
  • *
  • Posts: 10
    • View Profile
I could not find an answer if this is possible or not? I want to setup a pfsense server to connect to port 119 over different wans.

My question goes:

I have newsleecher ( a newsgroups program on a Win XP PC) that makes a connection to different servers (all have there own IP) all over port 119. I want PFsense to hardcoded route each connection to a server over a different WAN. So PFsense must see were i connect to (Ip adress or URL name e.g. 132.0.0.1 or 142.0.0.1 or binaries.newsplanet.com) and route accordingly over the specified WAN.

Is this possible??? and if so, How?

Thank you all in advance for answering..

I have a P4 1.7GHz with 768MB of RAM, this should do for 3 wans (8Mbit, 3Mbit, 3Mbit) right?

Topology:

Newsserver 1         Newsserver 2          Newsserver 3
132.0.0.1              142.0.0.1               152.0.0.1
      |                         |                          |
      |                         |                          |
      |                         |                          |
      |                         |                          |
      ---------------------------------------                       
      Wan1(DSL)          Wan2 (Wlan)      Wan3(Wlan)
 
                           PFSense (P4 1.7GHz)
                           10.0.0.0
      ---------------------------------------   
                                |                           
                                |                           
                                |                           
      --------------------------------------- 
                           10.0.0.2
                       ClarkConnect (i need this for server and other stuff)
                         192.168.1.0
      --------------------------------------- 
                                |                           
                                |                           
                                |                           
      ---------------------------------------
                       192.168.1.193
                              PC (connecting to port 119)
      --------------------------------------- 

Greetings Lampie
« Last Edit: December 19, 2006, 10:40:30 pm by lampie »

Offline hoba

  • Administrator
  • Hero Member
  • *****
  • Posts: 5837
  • What was the problem to this solution again?
    • View Profile
    • pfSense
Re: Multiple connection to different servers using the same port number
« Reply #1 on: December 19, 2006, 11:50:04 pm »
You have to create a bunch of firewallrules. I recommend using hosts-aliases (like wan1dst, wan2dst,...)to keep the amount of rules low.

Create a firewallrule at interfaces>lan like:
pass, proto tcp, source any, destination <wanXdst>, port <119>, gateway <wanX>.

Make sure these rules are above of other loadbalancing rules. Ruleorder is important to make this work correctly.

Offline lampie

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Multiple connection to different servers using the same port number
« Reply #2 on: December 20, 2006, 09:12:45 am »
Thank you hoba for responding to my question.
What do you mean by, I recommend using hosts-aliases (like wan1dst, wan2dst,...)to keep the amount of rules low. How do working with result in fewer rules? If i take 132.0.0.1 or Wan1dst, that shouldnt matter?

Please explain :)

Greetings xander

Offline hoba

  • Administrator
  • Hero Member
  • *****
  • Posts: 5837
  • What was the problem to this solution again?
    • View Profile
    • pfSense
Re: Multiple connection to different servers using the same port number
« Reply #3 on: December 20, 2006, 09:42:25 am »
Let's say you have a bunch of IPs that always should be routed through WAN1 (111.111.111.111, 123.123.123.123, 231.244.22,...) you could create a hosts-alias and add all these IPs to this alias. If you then use this alias in a firewallrule as destination you only need 1 firewallrule instead of having one firewallrule per IP. The same mechanism works for ports-aliases or networks-aliases. Also it might be more descriptive to have an alias for an IP instead of having the IP. Another advantage is, if this alias is referenced by a firewallrule and a nat rule for example, you only have to change the aliasdefinition and all settings that reference this alias will be changed too.

Offline lampie

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: Multiple connection to different servers using the same port number
« Reply #4 on: December 20, 2006, 11:39:16 am »
Wowww :0 Thats freaking handy :) i know the hosts file in windows so this works he same way. Interesting... Were can i edit these files, is there a tutorial on this?

Thank you cincerely

Offline hoba

  • Administrator
  • Hero Member
  • *****
  • Posts: 5837
  • What was the problem to this solution again?
    • View Profile
    • pfSense
Re: Multiple connection to different servers using the same port number
« Reply #5 on: December 20, 2006, 01:55:33 pm »
It's not a file. It's just firewall>aliases in the webgui. You can use aliases in all inputfields with red backgrounds.