Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Having a debian server with multiple NICs (eth0 and eth1) acting as a gateway. How would I be able to configure these NICs, so they can route the traffic from one to another.

Network layout:

DSL-router( ----> Debian gateway ----> Network 1 (
                                             |---> Network 2 (

In the current situation the servers are connected all to the switch.. which then is connected to the uplink(Fiber).

Configuring debian as a gateway is mainly for back-up purposes. If the fiber fails.. I somehow should be able to connect one of the cables to (eth0 or eth1) to the switch and route the traffic there. All machines already connected to the switch have gateway

Anyone any idea how could I establish such thing?

share|improve this question
up vote 0 down vote accepted

There are 2 ways to solve this problem.

  1. install an extra network card so you get eth0,1 and 2 connect 0 to the DSL Router, 1 and 2 respectively to network 1 and 2.

  2. Set up VLANS on eth1, configure your switch to allow vlans going over the port where eth1 is connected and basically split your network like that. In order to that that you need at least a layer 2 managed switch.

share|improve this answer
Can't I use an alias for eth1 or 2? e.g eth1:0 How would I configure the IP addresses? What should get what and what handles what? Thanks. – holasz Aug 23 '13 at 8:26
physically (or virtually) splitting your networks is safer as it allows you to assign PC's to one or the other subnet. In linux vlans on interfaces look like: eth1.1 eth1.2 (for vlan 1 and 2 resp.). – Flash Aug 23 '13 at 8:30
Thanks I will give it a try. – holasz Aug 23 '13 at 8:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.