some question

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have multihome network line. 
 
I want to use multi gateway, but i have some trouble
 
 
+-----------------------+
|   30.1.1.1 (eth0)                |  <----> 10.1.1.1 ( eth1) < ---> internet
|                                         |  
|   10.1.1.2 (eth1)                |
|                                         |  <----> 20.1.1.1 (eth2) < ---> internet
|   20.1.1.2 (eth2)                |
+------------------------+
 
 
eth1 ip : 10.1.1.2
gw ip  (eth1) : 10.1.1.1
 
eth2 ip : 20.1.1.2
gw ip  (eth2) : 20.1.1.1
 
ip route add default dev 10.1.1.1 dev eth1 table 1
ip route add default dev 20.1.1.1 dev eth2 table 2
 
ip rule add fwmark 0x01 table 1 prio 200
ip rule add fwmark 0x02 table 2 prio 255
 
iptables -t mangle -A OUTPUT -i eth1 -d 192.168.0.0/24 -t mangle -p tcp --dport ftp -j MARK --set-mark 1
iptables  -t mangle -A OUTPUT -i eth2 -d 192.168.2.0/24 -t mangle -p tcp --dport ftp -j MARK --set-mark 1
 
 
 
if i try to  connecting to 192.168.0.1, machine use line 1 ( eth1)
if i try to connecting to 192.168.2.1, machine use line 2( eth2)
 
Although Machine use gw2, machine source ip address is eth1 ip address.
 
Can I use eth2 ip address when Machine use gw2 ?
 
I can not use "iptables SNAT" in OUTPUT Chain. 
 
I want  just like this command  "iptables -t nat -A OUTPUT -o eth1 --to 10.1.1.2 -j SNAT"
but i can't use this command. 
 
 
Thanks for reading my articles
  









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

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux