Skip to contentSkip to conversation

Traffic shapping + routing in RH 7.1

LARTC Roberto Campos 2 participants 3 messages Dec 17, 2001 – Dec 18, 2001

lore
Share & tools
lore
#0 lore raw
0€	*†H†÷
 €0€10	+0€	*†H†÷
 €$€‚ĞContent-Type: text/plain;
	charset="iso-8859-1"

Content-Transfer-Encoding: 8bit

Hi ALL,

I'm new to TC and IPTABLES and i need help in setting up a filter/routing solution to an ISP.
I've read all the HOWTOs and i've reading LARTC messages for a month now. I still don't have a clue on how to do it 'cause sometimes people say it's easy, sometimes they say it's impossible.
I'm seeking help for it. Let's move to the subject.

We have a small ISP and we are moving a linux box running RH 7.1 to avoid having to set up BGP because we don't have an ASN.
What we want to do is to implement redundancy to the services. The way we managed to do it is like this:

ISP1 ISP2

   |                      |
   |                      |
   |______  ISP  _________|
   Linux RH 7.1 ver 2.4.2-2
             |
             |
  ___________|_______________
  |     |    |    |     |    |

boxes with services we provide

This is the cenario:

. ISP1 and ISP2 are our providers of connection to the internet . The Linux box is running IPTABLES and TC instaled (patched full) . The Linux is going to be our firewall and is not going to run any services at the interfaces to ISP1 and 2.
. The firewall is going to NAT all the packets allowing us to play with then accordingly, routing and dropping as we need.

What we have done so far?
We've managed to play with two default gateways equal cost and it works,
the problems are that we have two diferent ISPs to work with and the box send the packets without a simple logic, we just need that packets comming from eth0 to go back through eth0. If we ping the firewall from ISP1 sometimes it sends back the ICMP packet with the ip from the other interface and it's not allowed from ISP1 ou 2. That way it don't get past their firewalls.
If i can set this up to work telling linux to send back using eth0 the packets that comes from eth0 with the ip of eth0 or the internal ip that was used to forward in, i'll be happy.

Then i can use DNS Bind 9.1.0 to use the cheap links for the services i want and the expensive one to keep our clients flying on the net.

I can deal with the routing myself, my problems are that i can't understand how linux mounts the packet or routes it based on the port it came into the firewall when the destination machine is inside our ISP, like our sendmail machine, for example.

Any help apreciated.

Thanks in advance.

Roberto Campos
____________________________________________
Meu Provedor Tecnologias e Informática Ltda.
Rua Camerino, 128 Grs. 302
Centro - Rio de Janeiro - RJ - CEP 20080-010
Tel.: 55 21 22835173 (PABX/FAX)
Telefone Móvel - Celular: 55 21 91978284

Witch is the best way to do it?

Roberto Campos
____________________________________________
Meu Provedor Tecnologias e Informática Ltda.
Rua Camerino, 128 Grs. 302
Centro - Rio de Janeiro - RJ - CEP 20080-010
Tel.: 55 21 22835173 (PABX/FAX)
Telefone Móvel - Celular: 55 21 91978284
 ‚I0‚Y0‚ ÄŒê�Ù®âÇg٠ͳ0  *†H†÷ 0_1 0 UUS10U
VeriSign, Inc.1705U .Class 1 Public Primary Certification Authority0 991117000000Z 040106235959Z0�Ï1-0+U
$Certisign Certificadora Digital LTDA10U VeriSign Trust Network1?0=U 6Terms of use at https://www.certisign.com.br/RPA (c)991<0:U3Certisign Class 1 Consumer Individual Subscriber CA0�Ÿ0  *†H†÷ ��0�‰��¯’rÆøÆsȦB¦mÑœ›éCD7R°ÔşåH’í AgM ‚¤u›5Ş­ê]Üf¢VğHfx[ÛüÃø9l®rñdò©7Ëš:a±qÕ_qD#݈³zúÁİr ÕôzzªFs@íÉBõ %ç¹Ö·®ÇˆÉìõ±¸r, ƒ£�£0� 0$U0¤010U Affiliate1-80 `†H†øB0GU @0>0<
`†H†øE0.0,+ https://www.certisign.com.br/RPA0U0ÿ0 U0  *†H†÷ ��¢péy;Œ
ŒŒ°ÿàõh·ªhMSDÈŸâ®ÍÛ<ĞŞÁJíɺ Y²jò'&"ûÍZ
Œ¥¥êbfx椖Ûr©ay¦á º ïDMb¨È`}eŞS’ıJߤ»WÒ‡µê?Ì4�İàh²™J°D,Y¾dë¤ÃÛ¾‹8…:0‚è0‚Q  ¨)˜Æ‘A�•X®ê2E¹0  *†H†÷ 0�Ï1-0+U
$Certisign Certificadora Digital LTDA10U VeriSign Trust Network1?0=U 6Terms of use at https://www.certisign.com.br/RPA (c)991<0:U3Certisign Class 1 Consumer Individual Subscriber CA0 011212000000Z 021212235959Z0‚{1-0+U
$Certisign Certificadora Digital LTDA1'0%U Customer Support - Class 1 CSC1402U +Terms of use at www.certisign.com/RPA (c)001>0<U 5Authenticated by Certisign Certificadora Digital LTDA1'0%U Member, VeriSign Trust Network10U Persona Not Validated10U Digital ID Class 1 10URoberto L Campos1)0' *†H†÷  [email protected]\0  *†H†÷ K0HAÆF*
†uÕ~mË�I4€àIsAÂ4ÜTæM)4R <¾AÇë0¥š�H%f\�‡…ÂG½ÏÀâ:øm-£‚X0‚T0 U00rUk0i0g e c†ahttp://onsitecrl.verisign.com/CertisignCertificadoraDigitalLTDACustomerSupportClass1CSC/LatestCRL0�¬U �¤0�¡0�� †H†øE0��0(+https://www.verisign.com/CPS0b+0V0VeriSign, Inc.0=VeriSign's CPS incorp. by reference liab. ltd. (c)97 VeriSign0 †H†øB€0
†H†øE ÿ0  *†H†÷ ��s¼(Ï«�r`H§ş oŒRÀ,Ëô î´6¬D¥ø†¿£LL±äμş-ªŞÑyÀZS
åh�¸ÆõvE…„ØN£XÈ/;ZfŸXõÌ_À¼tn’)—Ò/Ş·$΀ŋ„+Yù÷ä×ì€éG£�m�Op™¤�1‚ı0‚ù0�ä0�Ï1-0+U
$Certisign Certificadora Digital LTDA10U VeriSign Trust Network1?0=U 6Terms of use at https://www.certisign.com.br/RPA (c)991<0:U3Certisign Class 1 Consumer Individual Subscriber CA ¨)˜Æ‘A�•X®ê2E¹0 + ‚¯0 *†H†÷  1  *†H†÷ 0 *†H†÷  1 011217034324Z0# *†H†÷  1e>üNÃùOáÛùÊúKóÿ‚A}0X *†H†÷  1K0I0
*†H†÷ 0*†H†÷ €0+0 *†H†÷ (0+0
*†H†÷ 0�õ +‚71�ç0�ä0�Ï1-0+U
$Certisign Certificadora Digital LTDA10U VeriSign Trust Network1?0=U 6Terms of use at https://www.certisign.com.br/RPA (c)991<0:U3Certisign Class 1 Consumer Individual Subscriber CA ¨)˜Æ‘A�•X®ê2E¹0  *†H†÷ @9«+ŸÑt{�’>"I�„Ò´êÿ–ÄÅç¤g2ò ÄäOrLJ΃NûÏ[y\îÃJŒB'¨½ñş�çÅñ¡iæ

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/

#1 lore raw

Hi ALL,

I'm new to TC and IPTABLES and i need help in setting up a filter/routing solution to an ISP.
I've read all the HOWTOs and i've reading LARTC messages for a month now. I still don't have a clue on how to do it 'cause sometimes people say it's easy, sometimes they say it's impossible.
I'm seeking help for it. Let's move to the subject.

We have a small ISP and we are moving a linux box running RH 7.1 to avoid having to set up BGP because we don't have an ASN.
What we want to do is to implement redundancy to the services. The way we managed to do it is like this:

ISP1 ISP2

   |                      |
   |                      |
   |______  ISP  _________|
   Linux RH 7.1 ver 2.4.2-2
             |
             |
  ___________|_______________
  |     |    |    |     |    |

boxes with services we provide

This is the cenario:

. ISP1 and ISP2 are our providers of connection to the internet . The Linux box is running IPTABLES and TC instaled (patched full) . The Linux is going to be our firewall and is not going to run any services at the interfaces to ISP1 and 2.
. The firewall is going to NAT all the packets allowing us to play with then accordingly, routing and dropping as we need.

What we have done so far?
We've managed to play with two default gateways equal cost and it works,
the problems are that we have two diferent ISPs to work with and the box send the packets without a simple logic, we just need that packets comming from eth0 to go back through eth0. If we ping the firewall from ISP1 sometimes it sends back the ICMP packet with the ip from the other interface and it's not allowed from ISP1 ou 2. That way it don't get past their firewalls.
If i can set this up to work telling linux to send back using eth0 the packets that comes from eth0 with the ip of eth0 or the internal ip that was used to forward in, i'll be happy.

Then i can use DNS Bind 9.1.0 to use the cheap links for the services i want and the expensive one to keep our clients flying on the net.

I can deal with the routing myself, my problems are that i can't understand how linux mounts the packet or routes it based on the port it came into the firewall when the destination machine is inside our ISP, like our sendmail machine, for example.

Any help apreciated.

Thanks in advance.

Roberto Campos
____________________________________________
Meu Provedor Tecnologias e Informática Ltda.
Rua Camerino, 128 Grs. 302
Centro - Rio de Janeiro - RJ - CEP 20080-010
Tel.: 55 21 22835173 (PABX/FAX)
Telefone Móvel - Celular: 55 21 91978284

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/

#2 lore raw
In reply to Roberto Campos
Quoted 7 lines · Roberto Campos

We've managed to play with two default gateways equal cost and it works,
the problems are that we have two diferent ISPs to work with and the box send the packets without a simple logic, we just need that packets comming from eth0 to go back through eth0. If we ping the firewall from ISP1 sometimes it sends back the ICMP packet with the ip from the other interface and it's not allowed from ISP1 ou 2. That way it don't get past their firewalls.

Use policy routing to force answers to go to the right link. This works for our setup, which looks quite like yours.

Quoted 3 lines

If i can set this up to work telling linux to send back using eth0 the packets that comes from eth0 with the ip of eth0 or the internal ip that was used to forward in, i'll be happy.

It works by using the source address to determine a gateway. Something like this:

ip rule add from 1.2.3.4 table 200
ip rule add from 2.2.3.4 table 300
ip route add default via 1.2.3.1 table 200
ip route add default via 2.2.3.1 table 300

(more or less).

Regards,

bert hubert

Signature · 8 lines
http://www.PowerDNS.com          Versatile DNS Software & Services
http://www.tk                              the dot in .tk
Netherlabs BV / Rent-a-Nerd.nl           - Nerd Available -
Linux Advanced Routing & Traffic Control: http://ds9a.nl/lartc

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://ds9a.nl/lartc/