Sponsored Content
Top Forums UNIX for Advanced & Expert Users Port redirection with exclusions Post 302558492 by beddo on Friday 23rd of September 2011 04:50:50 PM
Old 09-23-2011
Port redirection with exclusions

Hi folks,

I have an application that is acting up. I have another machine with a replacement application on it but because of the naming structure clients are using I cannot change the name to the replacement machine as it is also used to access other applications.

The host OS is Centos 5.6 and iptables is running. I'm familiar with setting it up for firewall purposes but my attempts to use it for redirection thus far have ended up in lost packets.

So, say the primary server is running on 1.1.1.1 and currently accepts SMTP mail.
The secondary server is running on 1.1.1.2 and also accepts SMTP mail.
I have a backup off site mail server running on 2.2.2.2

I need to redirect all connections received on port 25 by 1.1.1.1 to port 25 on 1.1.1.2 but not redirect 2.2.2.2 (and have the ability to exclude other hosts).

I'm sure this is possible, maybe a rule that accepts port 25 from 2.2.2.2 before the rule that redirects port 25 elsewhere?

One caveat, the connections also need to appear to be coming from the original source host otherwise it will stuff up the spam filtering app. I wonder if this will be possible without some trickery at the destination box to make it accept and reply as 1.1.1.1 without actually having the IP..hmm

For reference, there is no NAT involved. All IPs are Internet routable even though 1.1.1.1 and 1.1.1.2 are physically together.

It is probably fairly simple, I tried pulling what I've already tried from .bash_history but I think I did it from a screen session that hasn't kept it.
 

9 More Discussions You Might Find Interesting

1. Solaris

Find command with exclusions

Hi All I need to find the biggest files on our system BUT excluding some directories. I.E Find / -size +10000 (excluding 'platform'|'db' ..etc) |sort -n > file I tried grep -v but that can only do one expression at a time. Tried /usr/xpg4/bin/grep but cant use -v Please help Chris (5 Replies)
Discussion started by: JTS911
5 Replies

2. UNIX for Dummies Questions & Answers

Redirection to GNU screen attached serial port

I'm using GNU screen as a terminal to connect with a usb serial port. eg. screen /dev/tty.usbserial . This works well enough for manual processes. Is there a way to redirect the output of a script running in another session to the stdin of this virtual terminal? ie. I want to repeatedly send some... (1 Reply)
Discussion started by: geoffjMontreal
1 Replies

3. Solaris

How to enable Serial port on ILOM, when Network Port is enabled in parallel

Hi Everyone, In my environment, I have few T5220. On the iLOM Management Card, I have both Network and Serial port are cabled, I don't have any issues while I try to connect using Network Management port, but when I try to connect the serial port for the same server which is actually connected... (3 Replies)
Discussion started by: bobby320
3 Replies

4. IP Networking

Tcp ip port open but no such process (merged: Release A Port)

i want to kill a tcp connection by killing its pid with netstat -an i got the tcp ip connection on port 5914 but when i type ps -a or ps-e there is not such process running on port 5914 is it possible that because i do not log on with proper user account i can not see that process running? (30 Replies)
Discussion started by: alinamadchian
30 Replies

5. UNIX and Linux Applications

Weblogic Port redirection from 7001 to 7002

Hi, I have my WebLogic server up and running on port 7002, and can be accessed from : https://mydomain.com:7002/App1 i want to configure Port redirection from 7001 to 7002 if users Login to http://mydomain.com:7001/App1 it should automatically take them to ... (1 Reply)
Discussion started by: szs
1 Replies

6. Solaris

Cabling and adapters to communicate to service processor serial port from Windows PC with USB port.

Hello, I have an unloaded T5140 machine and want to access the ILOM for the first time and subsequently the network port after that., and then load Solaris 10 the final January 2011 build. The first part is what confuses me -the cabling. I am coming from a Windows machine (w/appropriate... (5 Replies)
Discussion started by: joboy
5 Replies

7. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

8. Shell Programming and Scripting

String of exclusions failed.

We are in a conversion where a list of six digit numbers needs to be excluded from an existing report. As new ones are added we have an ever longer string of "grep -v" commands like: grep -v 020516 | grep -v 020522 | grep -v 030132 | \ grep -v 030330 | grep -v 030357 | grep -v 050111 | \ ... (7 Replies)
Discussion started by: wbport
7 Replies

9. UNIX for Beginners Questions & Answers

Bash script, find the next closed (not in use) port from some port range.

hi, i would like to create a bash script that check which port in my Linux server are closed (not in use) from a specific range, port range (3000-3010). the print output need to be only 1 port, and it will be nice if the output will be saved as a variable or in same file. my code is: ... (2 Replies)
Discussion started by: yossi
2 Replies
ADDHOSTS(3PVM)							  PVM Version 3.4						    ADDHOSTS(3PVM)

NAME
pvm_addhosts - Add hosts to the virtual machine. SYNOPSIS
C int info = pvm_addhosts( char **hosts, int nhost, int *infos ) Fortran call pvmfaddhost( host, info ) PARAMETERS
hosts An array of strings naming the hosts to be added. Pvmd must already be installed and the user must have an account on the speci- fied hosts. nhost Integer specifying the length of array hosts. infos Integer array of length nhost which returns the status for each host. Values less than zero indicate an error, while positive val- ues are TIDs of the new hosts. host Character string naming the host to be added. info Integer status code returned by the routine. Values less than nhost indicate partial failure, and values less than 1 indicate total failure. DESCRIPTION
The routine pvm_addhosts adds the computers named in hosts to the configuration of computers making up the virtual machine. The names should have the same syntax as lines of a pvmd hostfile (see man page for pvmd3): A hostname followed by options of the form xx=y. If pvm_addhosts is successful, info will be equal to nhost. Partial success is indicated by 0 < info < nhost, and total failure by info < 1. The array infos can be checked to determine which host caused the error. The Fortran routine pvmfaddhost adds a single host to the configuration with each call. info will be 1 if successful or < 0 if error. The status of hosts can be requested by the application using pvm_mstat and pvm_config. If a host fails it will be automatically deleted from the configuration. Using pvm_addhosts a replacement host can be added by the application, however it is the responsibility of the application developer to make his application tolerant of host failure. Another use of this feature would be to add more hosts as they become available, for example on a weekend, or if the application dynamically determines it could use more computational power. EXAMPLES
C: static char *hosts[] = { "sparky", "thud.cs.utk.edu", }; info = pvm_addhosts( hosts, 2, infos ); Fortran: CALL PVMFADDHOST( 'azure', INFO ) ERRORS
The following error conditions can be returned by pvm_addhosts: PvmBadParam giving an invalid argument value. PvmAlready another task is currently adding hosts. PvmSysErr local pvmd is not responding. and in the infos vector: PvmBadParam bad hostname syntax. PvmNoHost no such host. PvmCantStart failed to start pvmd on host. PvmDupHost host already configured. PvmBadVersion pvmd protocol versions don't match. PvmOutOfRes PVM has run out of system resources. SEE ALSO
pvm_pvmd3(1PVM), pvm_delhosts(3PVM), pvm_start_pvmd(3PVM), pvm_config(3PVM), pvm_mstat(3PVM) 22 February, 1994 ADDHOSTS(3PVM)
All times are GMT -4. The time now is 01:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy