Hi all. I wonder if you can help me here. I have centos7 with 1 network interface and on that IFwe have 2 vlan.>From both vlan we'd like to reach the internet independently so basicallywith 2 different gateways. we tried with all the routes,rules etc but only on one vlan we are able to ping 8.8.8.8 for instance. Any suggestions/ideas? Cheers -- */Alfredo*
if you use more than one gateway, you have to 'decide' what traffic you want to go through each of them, (so you have to set up routes or user/group pools that controls access to interfaces etc ) it would still be a good idea to call one of the interfaces/gateways the "route of last resort", but bad ideas might work too. On 6/16/20 2:56 AM, Alfredo De Luca wrote:> Hi all. > I wonder if you can help me here. > > I have centos7 with 1 network interface and on that IFwe have 2 vlan. > From both vlan we'd like to reach the internet independently so basically > with 2 different gateways. > > we tried with all the routes,rules etc but only on one vlan we are able to > ping 8.8.8.8 for instance. > > Any suggestions/ideas? > Cheers > >
Did you setup outbound NAT for both vlans via iptables? Policy routing to multiple wan interfaces is a bit tricky,. It's been years since I did it, what I remember was using ip rules to categorize and tag the traffic, then alternate named ip route tables to direct the different tags at different gateways. On Tue, Jun 16, 2020, 1:57 AM Alfredo De Luca <alfredo.deluca at gmail.com> wrote:> Hi all. > I wonder if you can help me here. > > I have centos7 with 1 network interface and on that IFwe have 2 vlan. > From both vlan we'd like to reach the internet independently so basically > with 2 different gateways. > > we tried with all the routes,rules etc but only on one vlan we are able to > ping 8.8.8.8 for instance. > > Any suggestions/ideas? > Cheers > > > -- > */Alfredo* > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >
On 6/16/20 1:56 AM, Alfredo De Luca wrote:> I have centos7 with 1 network interface and on that IFwe have 2 vlan. > From both vlan we'd like to reach the internet independently so basically > with 2 different gateways.Look for documentation on "multi-homing": https://blogs.oracle.com/networking/advance-routing-for-multi-homed-hosts
Thanks guys. I ll go through all your rec? and links tomorrow and let you know. I might post my configuration so you can have a look at it. Cheers /Alfredo On Wed., 17 Jun. 2020, 3:34 am Gordon Messmer, <gordon.messmer at gmail.com> wrote:> On 6/16/20 1:56 AM, Alfredo De Luca wrote: > > I have centos7 with 1 network interface and on that IFwe have 2 vlan. > > From both vlan we'd like to reach the internet independently so > basically > > with 2 different gateways. > > > Look for documentation on "multi-homing": > > https://blogs.oracle.com/networking/advance-routing-for-multi-homed-hosts > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >