Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Linux Debian Maint Firewall > policy routing ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1571 of 1633
Post > Topic >>

policy routing troubles

by "Sapytsky Ilya" <sova00@[EMAIL PROTECTED] > May 22, 2008 at 03:20 PM

------=_Part_14383_598701.1211461948971
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Good day!
I'm getting trouble in policy routing on etch with linux-2.6.18-4-486
router
and dual network interface.
I want to make second MX for my domain on the same server as first, but on
another network interface from second ISP.
That is my firewall settings:
CSD is remote host
TEST1 is my server with MX

#INPUT
iptables -t mangle --append PREROUTING --protocol tcp --syn -m state
--state
NEW --source $CSD --dst $TEST1 --in-interface eth1 --jump CONNMARK
--set-mark 0x1
iptables -t mangle --append PREROUTING -m connmark --mark 0x1 --source
$CSD
--dst $TEST1 --in-interface eth1 --jump CONNMARK --restore-mark
iptables --append INPUT -m connmark --mark 0x1 --source $CSD --dst $TEST1
--in-interface eth1 --jump ACCEPT

# OUTPUT
iptables -t mangle --append OUTPUT -m connmark --mark 0x1 --source $TEST1
--dst $CSD --jump CONNMARK --restore-mark
iptables --append OUTPUT -m connmark --mark 0x1 --source $TEST1 --dst $CSD
--out-interface eth1 --jump ACCEPT


that is my ip settings:
GATE is my default gw for eth1 interface

ip route add $CSD dev eth1 table ytk
ip route add default via $GATE dev eth1 table ytk
/sbin/ip rule add fwmark 0x1 table ytk

The result is:
iptables INPUT rules p***** well, but output rules fails, because packets
wanted to get out through eth0.
May 22 16:18:09 test kernel: marked output finded IN= OUT=eth0 SRC=$TEST1
DST=$CSD LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=TCP SPT=22
DPT=3029
WINDOW=5792 RES=0x00 ACK SYN URGP=0

I googled this quiestion last 3 days and i have unsuccessful result.
Where is mistake and why packets, marked as 0x1 doesn't goes through eth1?
Anybody has any ideas about this question?
Thanks in advance.

------=_Part_14383_598701.1211461948971
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Good day!<br>I&#39;m getting trouble in policy routing on etch with
linux-2.6.18-4-486 router and dual network interface.<br>I want to make
second MX for my domain on the same server as first, but on another
network interface from second ISP.<br>
That is my firewall settings:<br>CSD is remote host<br>TEST1 is my server
with MX<br><br>#INPUT<br>iptables -t mangle --append PREROUTING --protocol
tcp --syn -m state --state NEW --source $CSD --dst $TEST1 --in-interface
eth1 --jump CONNMARK --set-mark 0x1<br>
iptables -t mangle --append PREROUTING -m connmark --mark 0x1 --source
$CSD --dst $TEST1 --in-interface eth1 --jump CONNMARK
--restore-mark<br>iptables --append INPUT -m connmark --mark 0x1 --source
$CSD --dst $TEST1 --in-interface eth1 --jump ACCEPT<br>
<br># OUTPUT<br>iptables -t mangle --append OUTPUT -m connmark --mark 0x1
--source $TEST1 --dst $CSD --jump CONNMARK --restore-mark<br>iptables
--append OUTPUT -m connmark --mark 0x1 --source $TEST1 --dst $CSD
--out-interface eth1 --jump ACCEPT<br>
<br><br>that is my ip settings:<br>GATE is my default gw for eth1
interface<br><br>ip route add $CSD dev eth1 table ytk<br>ip route add
default via $GATE dev eth1 table ytk<br>/sbin/ip rule add fwmark 0x1 table
ytk<br><br>
The result is:<br>iptables INPUT rules p***** well, but output rules
fails, because packets wanted to get out through eth0.<br>May 22 16:18:09
test kernel: marked output finded IN= OUT=eth0
SRC=$TEST1 DST=$CSD LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=TCP
SPT=22 DPT=3029 WINDOW=5792 RES=0x00 ACK SYN URGP=0<br>
<br>I googled this quiestion last 3 days and i have unsuccessful
result.<br>Where is mistake and why packets, marked as 0x1 doesn&#39;t
goes through eth1?<br>Anybody has any ideas about this question?<br>Thanks
in advance.<br>

------=_Part_14383_598701.1211461948971--


-- 
To UNSUBSCRIBE, email to debian-firewall-REQUEST@[EMAIL PROTECTED]
 a subject of "unsubscribe". Trouble? Contact
listmaster@[EMAIL PROTECTED]

 




 1 Posts in Topic:
policy routing troubles
"Sapytsky Ilya"  2008-05-22 15:20:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Nov 20 1:47:01 CST 2008.