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

Iptables + Iproute2 2 links



Galera estou configurando 2 links de internet. Em um link só sairá 80 e 443. e o outro link será o padrão.
O problema é que quando tento sair pelo outro link ele não vai!


Conexão Local
eth0
address 10.2.2.254
netmask 255.255.255.0

Conexão Link 1 Velox
eth1
address 192.168.1.69
netmask 255.255.255.0
gateway 192.168.1.254

Vlan Conexao Link 2
iface eth2.15 inet static
address 10.1.1.0.
netmask 255.255.255.248
gateway 10.1.1.1

ip route flush table link1
ip route flush table link2
ip route flush cache

ip route add 10.1.1.0/29 dev eth2.15 src 10.29.250.9 table link2
ip route add default via 10.29.250.10 table link2
ip rule add fwmark 2 table link2

ip route add 192.168.1.0/24 dev eth1 src 192.168.1.69 table link1
ip route add default via 192.168.1.254 table link1
ip rule add fwmark 3 table link1

iptables -I PREROUTING -t mangle -i eth0 -s 10.2.2.0/24 -d 0/0 -p tcp -m multiport --dports 80,443 -j MARK --set-mark 3
Ele sai normalmente utilizando o link 1;







Reply to: