Can't ping outside internal network

Issues related to configuring your network
Post Reply
slepacus miticus
Posts: 4
Joined: 2015/07/20 15:55:17

Can't ping outside internal network

Post by slepacus miticus » 2015/07/20 17:30:47

Firstly, i'm a newb so please take me slow if i don't realy know if what i,m doing is a centos misconfiguration or a virtual box misunderstanding. so...
in VBox i instaled a centos6.6(minimal) with 2 nics. eth0 is bridged and gets its ip from my router, eth1 ( an "internal network"), gets it's ip from the dhcp(server) that i installed on tins centos6.6. More i instaled another centos6.4(for diferentiation i named as 6.4- one card-eth0- "internal network"), this is a client and gets it's ip from the dhcp server.
The problem is that even though i can ping inside internal network (from centos6.6-eth1 to centos6.4-eth0 and reverse). the other way to say it is that from the client(6.4) i can ping the dhcp server, but not outside like ping 8.8.8.8.(i have no response - 100% packet loss). BUT from the dhcp server(6.6) i can ping outside(it gets out on eth0- i guess). My (non)educated guess is that dhcp server doesn't route client to the outside, or the traffic is iptables blocked, or i nead to bridge the 2 adapters, or the dhcp neads nead to act as nat(how), or i nead to bock routers dhcp-don't know why since it doesn't serve my subnet, or maybe i'm wrong on this one???)
Basicaly i installed pfsense(with dhcp enabled) and the client can get outside (ping 8.8.8.8) but i wanted to do my own dhcp-server on my internal network, with no pfsense involvement, just to learn but i got stuck and i nead some advice on what direction to look to enable routing trough dhcp server(getting outside, without virtualbox internal dhcp-thingamajig).

so my net is
my network settings:
router-address 10.10.10.1 -this is the gateway (as dhcp serves address from (.10-.100, with /24 mask) my computer have dhcp address of 10.10.10.100
centos6.6(dhcp server)
eth0(bridged adapter) have add 10.10.10.13 -received from router... goes to outside no problem
eth1(internal)-addres is 192.162.1.3 - static(it could be from dhcp but it doesn't change a bit my problem, not to say that a server should have a static ip)
centos6.4
eth0(internal)-ip add of 192.168.1.10- (received from dhcp)

detailed settings on
centos6.6(dhcp-server) interfaces configuration are:
for eth0 interface:
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp

for eth1 interface
vi /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
IPADDRESS=192.168.1.255
NETMASK=255.255.255.0
#GATEWAY=10.10.10.1 -gateway

for client centos6.4-eth0 interface config is
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
TYPE=Ethernet
NM_CONTROLLED=no
BOOTPROTO=dhcp

dhcp-server settings(on centos 6.6)
vi /etc/sysconfig/dhcpd
DHCPARGS=eth1 #from this interface dhcp gets that clients request ip and from here serves it

vi /etc/dhcp/dhcpd.conf
option-domain-name "asd.local";
option domain-name-servers 192.168.1.3, 8.8.8.8, 8.8.4.4;

default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
authoritative;
log-facility local7;

subnet 192.168.1.0 netmask 255.255.255.0{
range 192.168.1.10 192.168.1.20;
option domain-name-servers 192.168.1.3;
option routers 192.168.1.3;
option broadcast-address 192.168.1.255;
default-lease-time 600;
max-lease-time 7200;
}

i'll give the content of resolv.conf, even though i don't think it is relevant since i ping 8.8.8.8 not "google.com", so it doesn't even get to the dns:
vi /etc/resolv.conf
nameserver 10.10.10.1

I wanted to simulate a real life network some computers and on one a dhcp server wich will act as a gate to the interwebs, this is why i don't want VirtualBox to get in my lab. Even though the server(6.6) can ping outside the other computers don't, and i got stuck...
maybe i need to bridge eth0 and eth1 of the server so that the traffic will get routed trough it, or somewhere i missed a gateway, maybe i have to modify something in iptables, (selinux is disabbled! by me). Please help with a direction or a link to something.

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: Can't ping outside internal network

Post by lightman47 » 2015/07/27 15:42:12

Not sure this is your answer but did you enable forwarding?:

http://wiki.centos.org/TipsAndTricks/IPForwarding

Post Reply