All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wang Jian <lark@linux.net.cn>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] UDP port 1194 marking/routing problem
Date: Wed, 06 Apr 2005 11:23:59 +0000	[thread overview]
Message-ID: <20050406191312.027E.LARK@linux.net.cn> (raw)
In-Reply-To: <0b6701c53a96$8ef69fc0$6e69690a@RIMAS>

Hi Remus,

It seems that 

iptables -t mangle -A POSTROUTING -o eth0 -p udp --dport 1194 -j MARK \
    --set-mark 0x990

will not take effect. (didn't you typo -A as -D?)

POSTROUTING is looked up after routing decision is made. Because the
default route is dev eth1, the output device is eth1, -o eth0 will not
match.

You should use

iptables -t mangle -A PREROUTING -p udp --destination <your openvpn \
    peer> --dport 1194 -j MARK ....

But I don't think you need to use MARK to do policy routing. It's a
little overkill.

Why not simply route all traffic to your openvpn peer via device eth0?


On Wed, 6 Apr 2005 11:51:16 +0100, "Remus" <rmocius@auste.elnet.lt> wrote:

> 
> Hi folks,
> 
> I have OpenVPN (respect for it developers) running on my FW.
> Is has two external NICs and on internal everything is fine, except
> I want OpenVPN (UDP port 1194) going not via default route/network interface.
> 
> I use such commands:
> 
> iptables -t mangle -D POSTROUTING -o eth0 -p udp --dport 1194 -j MARK --set-mark 0x990                                             
> ip rule add fwmark 0x990 table openvpn1                                                                                           
> ip route add default via $P2 dev eth0 table openvpn1 
> 
> eth0 is FW's not default external NIC.
> 
> I have in use very similar iptables rules for my email server (TCP ports) and etc.
> Everything works fine. 
> What I'm doing wrong with marking/routing the UDP port?
> 
> Regards
> 
> Remus
> 



-- 
  lark

_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

  reply	other threads:[~2005-04-06 11:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-06 10:51 [LARTC] UDP port 1194 marking/routing problem Remus
2005-04-06 11:23 ` Wang Jian [this message]
2005-04-06 13:48 ` Remus
2005-04-06 14:03 ` Wang Jian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050406191312.027E.LARK@linux.net.cn \
    --to=lark@linux.net.cn \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.