LinuxQuestions.org
Help answer threads with 0 replies.
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 04-24-2008, 01:31 PM   #1
tkmbe
Member
 
Registered: Jun 2005
Location: Obera, Argentina
Distribution: OpenSuse 10.3, Debian 4.0, Debian 3.1
Posts: 38

Rep: Reputation: 15
Ho to use fwmark with masquearading ?


Hello

I want to route all smtp trafic to a 2. provider.
I'm using masquerading on both ehternet interfaces which
everyone has a modem connected.
I have 2 seperate tables for special routing.
What I have done:

iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 25 -j MARK --set-mark 0x7
iptables -t mangle -A PREROUTING -p tcp -m tcp --dport 25 -j RETURN

iptables -t mangle -A OUTPUT -p tcp -m tcp --dport 25 -j MARK --set-mark 0x7
iptables -t mangle -A OUTPUT -p tcp -m tcp --dport 25 -j RETURN

ip rule add fwmark 0x7 table gugus

This doesn't seem to work.
Tcpdump shows me that the packets goes still through default
gateway an not through table gugus.
How can I see if the packet has the mark 0x7 set?
What do I wrong?
BTW: The smtp packets are forwared packets ...

Thanks a lot for any help

Beat
 
Old 04-26-2008, 02:46 AM   #2
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
You need a second routing table, provide ip addresses and i can help or look at my other similar solution and work with that.

http://www.linuxquestions.org/questi...gh-vpn-633389/
 
  


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
$300 for the solution - fwmark, iptables vincentdipiazza Linux - Networking 2 03-19-2008 02:11 PM
$300 for the solution - fwmark, iptables vincentdipiazza Linux - Newbie 2 03-19-2008 01:52 PM
Problem getting fwmark work with iproute2 MuTuO Linux - Software 0 04-23-2006 04:29 AM

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

All times are GMT -5. The time now is 08:32 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