* iptables -A OUTPUT --set-mark , routing
@ 2004-07-21 9:03 Dmitry Melekhov
2004-07-22 10:09 ` George Alexandru Dragoi
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Melekhov @ 2004-07-21 9:03 UTC (permalink / raw)
To: netfilter
Hello!
I need to route traffic to specific port from localhost to specific gateway.
I'm testing this on icmp.
I wrote rules:
iptables -t mangle -A OUTPUT -p icmp -j MARK --set-mark 80
ip rule add prio 221 table 221 fwmark 80
ip route add default table 221 proto static nexthop via 192.168.22.221
dev eth0
Then I try to ping something from different subnet:
ping 10.1.1.1
connect: Network is unreachable
If I add rule
iptables -t mangle -A PREROUTING -p icmp -j MARK --set-mark 80
Then I can successefully ping 10.1.1.1 from another host (my host is
default gw for it, it's address is 192.168.22.229).
Hmmm.
How can I route marked packets from localhost?
ping 10.1.1.1
PING 10.1.1.1 (10.1.1.1) from 192.168.22.254 : 56(84) bytes of data.
From 192.168.22.229: icmp_seq=1 Redirect Host(New nexthop: 192.168.22.221)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: iptables -A OUTPUT --set-mark , routing
2004-07-21 9:03 iptables -A OUTPUT --set-mark , routing Dmitry Melekhov
@ 2004-07-22 10:09 ` George Alexandru Dragoi
0 siblings, 0 replies; 2+ messages in thread
From: George Alexandru Dragoi @ 2004-07-22 10:09 UTC (permalink / raw)
To: netfilter
First, for marks, use hexa numbers, like --set-mark 0x80 and .. fwmark 0x80
I don;t know what proto static nexthop is, i dont use them :)
Make sure you did an ip route flush cache
On Wed, 21 Jul 2004 14:03:40 +0500, Dmitry Melekhov <dm@belkam.com> wrote:
> Hello!
>
> I need to route traffic to specific port from localhost to specific gateway.
>
> I'm testing this on icmp.
>
> I wrote rules:
>
> iptables -t mangle -A OUTPUT -p icmp -j MARK --set-mark 80
> ip rule add prio 221 table 221 fwmark 80
> ip route add default table 221 proto static nexthop via 192.168.22.221
> dev eth0
>
> Then I try to ping something from different subnet:
>
> ping 10.1.1.1
> connect: Network is unreachable
>
> If I add rule
> iptables -t mangle -A PREROUTING -p icmp -j MARK --set-mark 80
>
> Then I can successefully ping 10.1.1.1 from another host (my host is
> default gw for it, it's address is 192.168.22.229).
>
> Hmmm.
>
> How can I route marked packets from localhost?
>
> ping 10.1.1.1
> PING 10.1.1.1 (10.1.1.1) from 192.168.22.254 : 56(84) bytes of data.
> From 192.168.22.229: icmp_seq=1 Redirect Host(New nexthop: 192.168.22.221)
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-07-22 10:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-21 9:03 iptables -A OUTPUT --set-mark , routing Dmitry Melekhov
2004-07-22 10:09 ` George Alexandru Dragoi
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.