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.
  • ADSL Router: Cisco 877 (172.16.0.254)
  • PC1 (172.16.0.10) to port1 of router
  • PC2 (172.16.0.20) to port2 of router
  • Server, 2 NICs, eth0 to port0 of router. (172.16.0.240)

Everything is OK with the above setup.


Now, eth1 of Server connects to gigabit switch. DHCP3 on Server is serving requests on eth1, using this configuration

subnet 172.16.0.0 netmask 255.255.255.0 { 
  range 172.16.0.151 172.16.0.199; 
  option domain-name-servers 194.30.220.117,194.30.220.114; 
  option domain-name "XXXXXXXXXXXXXXX"; 
  option routers 172.16.0.1; 
  option broadcast-address 172.16.0.255; 
  default-lease-time 600; 
  max-lease-time 7200; 
} 

and /etc/network/interfaces

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet static
        address 172.16.0.240
        netmask 255.255.255.0
auto eth0

allow-hotplug eth1
iface eth1 inet static
    address 172.16.0.1
    netmask 255.255.255.0
    up route add -host 255.255.255.255 eth1
auto eth1

Clients get IP, but are unable to access other ports of the router (PC1 & PC2) or the Server itself (either on 172.16.0.1 or 172.16.0.240). Also, they are unable to access the internet.

I've enabled ipv4 forwarding echo "1" > /proc/sys/net/ipv4/ip_forward

also route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
255.255.255.255 0.0.0.0         255.255.255.255 UH    0      0        0 eth1
172.16.0.0      0.0.0.0         255.255.255.0   U     0      0        0 eth0
172.16.0.0      0.0.0.0         255.255.255.0   U     0      0        0 eth1

Ideas?

Thank you

share|improve this question
add comment

1 Answer 1

The problem you're having is that you're trying to use routing, but you're not routing. Routing implies the passage of traffic between different networks. You have two interfaces that are on the same network. What you want is either:

  • To create a second network off of eth1 of the server and have clients behind it function on that network, default routing to the eth1 interface IP, and ultimately out to the Internet. This would require you to make sure all your devices are aware of how to get to each side of Server.
  • Create a bridged ethernet between ports eth0 and eth1. I honestly haven't done this before so I'm hesitant to recommend it, but my understanding is that you would assign one IP to a set of ports and that the ports would act as a layer 2 switch.
share|improve this answer
    
Thank you very much. Bridginq was all i needed... –  poscaman Jul 3 '11 at 15:41
add comment

Your Answer

 
discard

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.