Basic networking: Centos Server Router + Ubuntu Client setup.. unable to access outside world from client

Posted by ale on Server Fault See other posts from Server Fault or by ale
Published on 2012-04-08T14:39:35Z Indexed on 2012/04/08 17:34 UTC
Read the original article Hit count: 262

Filed under:
|
|
|
|

I am trying to set up my Centos Server with two NICs as a router. eth0 is connected to the outside world and eth1 is connected to an Ubuntu client.

Here's eth0 on the server:

DEVICE=eth0
BOOTPROTO=dhcp 
ONBOOT=yes
TYPE=Ethernet

eth1 on the server:

DEVICE=eth1
BOOTPROTO=static
IPADDR=192.168.0.10 # a free address on my network
ONBOOT=yes
TYPE=Ethernet

My server has IPv4 packet forwarding turned on and my iptables only contains:

# iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
# iptables --append FORWARD --in-interface eth1 -j ACCEPT

My Ubuntu client has this in its /etc/network/interfaces

auto lo
iface lo inet loopback

iface eth0 inet dhcp
   gateway 192.168.0.10

but I can't get an Internet connection from the server for my client. I can't even ping my server from the client:

$ ping 192.168.0.10
Destination Host Unreachable

© Server Fault or respective owner

Related posts about ubuntu

Related posts about networking