Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 09-05-2005, 11:40 PM   #1
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,430

Rep: Reputation: 55
What is a gateway? can I have more than one gateway on a vlan?

What is a gateway? can I have more than one gateway on a vlan?

If my ip block is

Can I have a gateway ?

Can I only have one gateway per vlan?
Old 09-06-2005, 01:55 AM   #2
Registered: Aug 2004
Location: .au
Distribution: debian, BSD
Posts: 104

Rep: Reputation: 17
you can have multiple gateways to different networks, but only one default gateway. What do you need multiple gateways for? Also, vLAN's have nothing to do with routing, unless it's within the scope of policy routing.

What are you trying to do?
Old 09-06-2005, 08:22 AM   #3
Registered: Oct 2003
Location: St Paul, MN
Distribution: Fedora 8, Fedora 9
Posts: 513

Rep: Reputation: 30
A gateway is a network device on a subnet to which network traffic is sent if the host machine can't figure out what to do with it - this will mean all traffic that doesn't have an entry in the host's routing table.

As angrybeaver quite correctly points out, you can have multiple gateways, but only one default gateway because at the end of the day the host needs to have somewhere specified as a 'catch-all' if it gets to a point where it can't figure out where to send network traffic.

In practice, it's unusual to have more than one gateway specified on a host. The only reason you would possibly do so would be to provide redundancy in case one gateway went offline. It's not possible (as far as I know) to do load-balancing between two gateways - at least not with a standard linux install.
Old 09-06-2005, 10:43 AM   #4
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
For our setup we have specific subnet ranges for different classes of machines and each of these "vlans" though that doesn't match the technical definition. Classes would be Linux servers, Unix servers, Windows servers, and Workstations (Unix/Linux/Windows in the last all using DHCP).

For each of these subnets we have a different router which has the IP at the beginning of the range (e.g. for the subnet 10.0.17 we would have the router at We would then use this router's IP as the "gateway" when configuring each of the servers in that "vlan".

The Gateway is just the default route for packets outside the subnet. So if sending packes from a host at to for example it would have to go through to get there. You'd see this when doing traceroute to from

You can add other hosts to the route table with "route add". Therefoe you can have multiple routes on a local host but the gateway in this sense is the default route. Of course in 10.0.19 we have another router that would have iP and it would be used as the gateway for any host in that subnet.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
lm10.0 gateway is set but when I reboot I have to set the gateway rharvey32 Mandriva 8 02-13-2006 01:35 PM
how to connect a gateway linux with vlan ? ctis78 Linux - Networking 2 03-25-2005 07:28 AM
Odd problem: Gateway unreachable after certain amount of time (Win XP Gateway) SocialEngineer Linux - Networking 2 08-13-2004 12:54 AM
gateway alaios Linux - Networking 2 06-09-2004 08:49 AM
Gateway jonnyjonjon Linux - Networking 2 01-29-2003 08:32 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:39 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration