Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have Debian Lenny machine with 3 interfaces enabled (eth0-2), and I have problems as follow.

  • eth1 is connected to a router and this router has portforwarding for port80.
  • eth2 is connected direct to the internet

If I open a website hosted on my system via the router it works fine. If I try to open the same via the eth2 connetion it does not!

tshark shows incomming trafic on eth2 but nothing goes out there.

iptabes accepts all

My routing table:

Ziel            Router          Genmask         Flags Metric Ref    Use Iface
10.9.0.2        *               255.255.255.255 UH    0      0        0 tun0
212.236.24.128  *               255.255.255.224 U     0      0        0 eth2
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
10.9.0.0        10.9.0.2        255.255.255.0   UG    0      0        0 tun0
default         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
default         212.236.024.129 0.0.0.0         UG    0      0        0 eth2
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
share|improve this question

migrated from stackoverflow.com Jun 28 '12 at 23:54

This question came from our site for professional and enthusiast programmers.

    
You cannot use multiple default gateways on a server. The simplest fix would be to put your internet connection on the router and design your network so everything is defaulted through the router. –  Mike Pennington Jun 28 '12 at 12:13
    
i need the network configuration like it is<br> for outgoing internet it takes the route via my router thats ok<br> but for incoming it shouldt answer on the same interface where the incomming accepts<br> i know that 3 default routes are wrong but how can i solve that problem –  helmi Jun 28 '12 at 12:43
    
You can solve the problem by removing two of the three defaults. That sounds like a snarky answer, but it is the best anyone can give unless you give us more information or change your mind about leaving the network configuration as it is –  Mike Pennington Jun 28 '12 at 13:00
    
1.) what i need is following. access from outside via my router<br> 2.) also access from outside direct to the server via eth2 and thats the problem direct access via eth2 wil not responded on the same interface<br> now i removed all default routes except those of eth1 but nothing changed in the behaver –  helmi Jun 28 '12 at 15:09
    
Then look up how to do port forwarding and NAT on your router –  Mike Pennington Jun 28 '12 at 15:11

1 Answer 1

You cannot use multiple default gateways on a server. The simplest fix would be to put your internet connection on the router and design your network so everything is defaulted through the router. You will need to configure NAT / port forwarding to make this work as you hope for.

share|improve this answer

Your Answer

 
discard

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