0

I have 2 nic server. eth0 and eth1 eth0 conected internet and its connected Static IP address 192.168.1.200 DNS 192.168.1.1 GW 192.168.1.1

eth1 configured as dhcp server and assign ip address to clients. ip address 192.168.27.1 DNS 192.168.27.1 GW 192.168.27.1 RANGE 192.168.27.2, 192.168.27.200

DHCP client ping with eth0 and modem but the problem is i cannot access internet dhcp client cannot ping google.com

2
  • @jimmij /etc/resolv.conf option domain-name-servers 192.168.1.1, 8.8.8.8, 8.8.4.4 Nov 14, 2018 at 9:07
  • @ jimmij option domain-name-servers 192.168.1.1, 8.8.8.8, 8.8.4.4 option domain-name-servers 192.168.1.1 ; generated by /sbin/dhclient-script search domain.name dhcp nameserver 192.168.1.1 nameserver 8.8.8.8 Nov 14, 2018 at 9:20

1 Answer 1

2

You've specified a default gateway 192.168.27.1 for eth1. This means you're saying any system on the IPv4 internet should be reachable by sending packets through 192.168.27.1.

The system is probably believing you and trying to connect to the internet through 192.168.27.1 because its gateway entry happens to be before the 192.168.1.1 gateway entry in the routing table.

If eth1 is not connected to the internet, don't specify a default gateway for it. Leave the GW entry for eth1 blank.

From the question comments:

/etc/resolv.conf option domain-name-servers 192.168.1.1, 8.8.8.8, 8.8.4.4

option domain-name-servers ... is the configuration syntax for dhcpd.conf; it is not correct for /etc/resolv.conf.

2
  • Thank you for ur information. But dhcp client can ping 192.168.1.1. It is the eth0 GATEWAY Nov 14, 2018 at 10:04
  • Yes, because it is clear to the server that any traffic to 192.168.1.* must go out of eth0. But the problem is in routing any traffic whose destination is neither 192.168.1.* nor 192.168.27.*. What does ip route show or /sbin/route -n say on the server?
    – telcoM
    Nov 14, 2018 at 11:14

Not the answer you're looking for? Browse other questions tagged .