LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-10-2004, 04:41 PM   #1
yvesg
Member
 
Registered: May 2004
Distribution: SuSe v9.3 Professional
Posts: 33

Rep: Reputation: 15
IP Routing Question


Is it possible to route traffic from one port to another on the SAME interface ?

I have an ethernet interface (eth0) that is connected to the internet. Traffic is coming IN on port 5025 and needs to be resend (out) to port 25 on the same interface.

(This is used to connect outlook to my providers smtp server)
Is it also possible to filter on MAC address so only my computer can send data to this port ?

Tnx in advance !
 
Old 05-10-2004, 08:04 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

I can't imagine *why* you'd want to do this - but you certainly *can*.

FOR EXAMPLE:
1. Have your listener process open *two* sockets.
2. The server thread would call a socket(), listen(),
bind (5025) and accept () ... just like I imagine it's doing now.
3. But you'd *also* open another, second socket for writing out
the data you're reading on input port 5025.
4. You might also want to have this socket bind() to port 25.
And maybe even disable your standard mail daemon (smtp port 25)
from coming up at system boot.

Good luck!
 
Old 05-11-2004, 06:13 AM   #3
zaphodiv
Member
 
Registered: Oct 2003
Distribution: Slackware
Posts: 388

Rep: Reputation: 30
>Traffic is coming IN on port 5025 and needs to be resend (out) to
>port 25 on the same interface.
>my providers smtp server

Outgoing email?
You mean port 25 on a remote computer, not listening on the interface.

You need to be very carefull that you don't leave a mail relay accessable from the internet.


You could do it with iptables or with portfwd
with somthing like this, fill in the numeric ip address of you ISP's mail server.
Change 192.168.0.0/16 if you are using a different range of lan addresses eg 10.0.0.0/8

/*
* mailrelay.cfg
*
* Forward all connections on TCP port 5025 to 1.2.3.4:25 */
tcp { 192.168.0.0/16:5025 { => 1.2.3.4:25 } }
/*
* eof: mailrelay.cfg
*/

Portfwd is somtimes usfull because you can run it without root access, though without root you can't usually listen on ports 1-1024.

>filter on MAC address so only my computer can send data to this port ?

That can probably be done with an iptables rules

Last edited by zaphodiv; 05-11-2004 at 06:25 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Routing question jeffvph Linux - Networking 2 11-07-2005 07:14 PM
routing question jeffvph Linux - Networking 9 07-24-2005 07:09 PM
routing question hsegtreas Linux - Networking 2 08-28-2004 05:19 PM
routing question gubak Linux - Newbie 1 07-23-2004 02:41 AM
Routing Question brokenflea Linux - Networking 2 12-05-2003 03:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration