All of lore.kernel.org
 help / color / mirror / Atom feed
* ip forwarding issue with dual gateway
@ 2009-11-06 10:55 J. Bakshi
  2009-11-09  3:10 ` J. Bakshi
  0 siblings, 1 reply; 4+ messages in thread
From: J. Bakshi @ 2009-11-06 10:55 UTC (permalink / raw)
  To: netfilter

Hello,

First of all I request you to bear with me as I am not a network guru.

I have two lan cards in my server which is used to share internet
connection with the help of iptables. The config is as below

``````````````````````````````````
echo 1 >  /proc/sys/net/ipv4/ip_forward

iptables -A FORWARD -i ${WAN_IFACE} -o ${LAN_IFACE} -s 192.168.0.0/24 -m
conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE
~~~~~~~~~~~~~~~~~~~~~~~~

The setup is working well.  I have one more internet connection which is
cable based so no modem. Hence I again need 2 cards one to connect with
the ISP and forward it to another card which will act as gateway ; just
like above config. The question is shall I follow the above
configuration for the second internet connection ? Is there any
possibility of conflict between the two connection then ? I don't need
any load balancing setup but a setup where I can get the two internet
connections separately.  Please enlighten me. Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ip forwarding issue with dual gateway
  2009-11-06 10:55 ip forwarding issue with dual gateway J. Bakshi
@ 2009-11-09  3:10 ` J. Bakshi
  2009-11-09  8:01   ` Marek Kierdelewicz
  0 siblings, 1 reply; 4+ messages in thread
From: J. Bakshi @ 2009-11-09  3:10 UTC (permalink / raw)
  To: netfilter

J. Bakshi wrote:
> Hello,
>
> First of all I request you to bear with me as I am not a network guru.
>
> I have two lan cards in my server which is used to share internet
> connection with the help of iptables. The config is as below
>
> ``````````````````````````````````
> echo 1 >  /proc/sys/net/ipv4/ip_forward
>
> iptables -A FORWARD -i ${WAN_IFACE} -o ${LAN_IFACE} -s 192.168.0.0/24 -m
> conntrack --ctstate NEW -j ACCEPT
> iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
> iptables -A POSTROUTING -t nat -j MASQUERADE
> ~~~~~~~~~~~~~~~~~~~~~~~~
>
> The setup is working well.  I have one more internet connection which is
> cable based so no modem. Hence I again need 2 cards one to connect with
> the ISP and forward it to another card which will act as gateway ; just
> like above config. The question is shall I follow the above
> configuration for the second internet connection ? Is there any
> possibility of conflict between the two connection then ? I don't need
> any load balancing setup but a setup where I can get the two internet
> connections separately.  Please enlighten me. Thanks
> --
>   

any suggestion please ?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ip forwarding issue with dual gateway
  2009-11-09  3:10 ` J. Bakshi
@ 2009-11-09  8:01   ` Marek Kierdelewicz
  2009-11-10  2:52     ` J. Bakshi
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Kierdelewicz @ 2009-11-09  8:01 UTC (permalink / raw)
  To: J. Bakshi; +Cc: netfilter

> Hello,

Hello Bakshi

> I have two lan cards in my server which is used to share internet
> connection with the help of iptables. The config is as below

Read the following paragraph of LARTC-howto: [1].

With your current iptables config it's enough to change default gateway
and you'll use another upstream link (for failover you can do it by
detecting gateway-down event with eg. apinger [2]). You can
do load-balancing with policy routing [1].

[1] http://lartc.org/howto/lartc.rpdb.htm
[2] http://apinger.jajcus.net/trac/

cheers,
Marek

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ip forwarding issue with dual gateway
  2009-11-09  8:01   ` Marek Kierdelewicz
@ 2009-11-10  2:52     ` J. Bakshi
  0 siblings, 0 replies; 4+ messages in thread
From: J. Bakshi @ 2009-11-10  2:52 UTC (permalink / raw)
  To: Marek Kierdelewicz; +Cc: netfilter

Marek Kierdelewicz wrote:
>> Hello,
>>     
>
> Hello Bakshi
>
>   
>> I have two lan cards in my server which is used to share internet
>> connection with the help of iptables. The config is as below
>>     
>
> Read the following paragraph of LARTC-howto: [1].
>
> With your current iptables config it's enough to change default gateway
> and you'll use another upstream link (for failover you can do it by
> detecting gateway-down event with eg. apinger [2]). You can
> do load-balancing with policy routing [1].
>
> [1] http://lartc.org/howto/lartc.rpdb.htm
> [2] http://apinger.jajcus.net/trac/
>
> cheers,
> Marek
>
>   

Hello Marek,

My present setup does not require the load balancing. The server should
simply provide two different internet connection. The connections are
based on cable hence no modem, so the server needs to forward the
connection to eth.  Thanks for the lrtc link.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-11-10  2:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-06 10:55 ip forwarding issue with dual gateway J. Bakshi
2009-11-09  3:10 ` J. Bakshi
2009-11-09  8:01   ` Marek Kierdelewicz
2009-11-10  2:52     ` J. Bakshi

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.