LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-19-2019, 07:54 AM   #1
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Rep: Reputation: 2
cannot ping from server to client but can ping from client to server.


i've centos7.5 in both server and client in VMware. i can ping from client to server succesfully but i can not ping from server to client. mine /etc/hosts files are :-

server:
Code:
192.168.40.3	centos75client	centos75client.db.net
192.168.40.1	centos75dns		centos75dns.db.net
and same as this, is client's /etc/hosts file.

I set on both server and client firewall runtime and permanent ftp and dns enabled and added in both trusted and public and also added 53 and 21 port numbers.

this I set in both server and client.

output of ping from server to client :-
Code:
[root@centos75dns centos75]# ping  centos75client
PING centos75client (192.168.40.3) 56(84) bytes of data.
From centos75dns (192.168.40.1) icmp_seq=1 Destination Host Unreachable
From centos75dns (192.168.40.1) icmp_seq=2 Destination Host Unreachable
From centos75dns (192.168.40.1) icmp_seq=3 Destination Host Unreachable
From centos75dns (192.168.40.1) icmp_seq=4 Destination Host Unreachable
From centos75dns (192.168.40.1) icmp_seq=5 Destination Host Unreachable
From centos75dns (192.168.40.1) icmp_seq=6 Destination Host Unreachable

[root@centos75dns centos75]# ping  192.168.40.3
PING 192.168.40.3 (192.168.40.3) 56(84) bytes of data.
From 192.168.40.1 icmp_seq=1 Destination Host Unreachable
From 192.168.40.1 icmp_seq=2 Destination Host Unreachable
From 192.168.40.1 icmp_seq=3 Destination Host Unreachable
From 192.168.40.1 icmp_seq=4 Destination Host Unreachable
how to get pinging both side.
 
Old 11-19-2019, 08:55 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
What is the routing table on the client?

Another factor may be the Vmware network setup, where I don't have any expertise I am afraid.
 
Old 11-19-2019, 09:35 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by rahulvishwakarma View Post
i've centos7.5 in both server and client in VMware. i can ping from client to server succesfully but i can not ping from server to client. mine /etc/hosts files are :-
server:
Code:
192.168.40.3	centos75client	centos75client.db.net
192.168.40.1	centos75dns		centos75dns.db.net
and same as this, is client's /etc/hosts file.
Bolded a line for emphasis only; you set the client and host with the SAME /etc/hosts file? Is there an /etc/hosts file that contains the addresses of BOTH servers with their associated names??
Quote:
I set on both server and client firewall runtime and permanent ftp and dns enabled and added in both trusted and public and also added 53 and 21 port numbers. this I set in both server and client.
Which protocol did you allow?
Quote:
output of ping from server to client :-
Code:
[root@centos75dns centos75]# ping  centos75client
PING centos75client (192.168.40.3) 56(84) bytes of data.
From centos75dns (192.168.40.1) icmp_seq=1 Destination Host Unreachable
From centos75dns (192.168.40.1) icmp_seq=2 Destination Host Unreachable
From centos75dns (192.168.40.1) icmp_seq=3 Destination Host Unreachable
From centos75dns (192.168.40.1) icmp_seq=4 Destination Host Unreachable
From centos75dns (192.168.40.1) icmp_seq=5 Destination Host Unreachable
From centos75dns (192.168.40.1) icmp_seq=6 Destination Host Unreachable

[root@centos75dns centos75]# ping  192.168.40.3
PING 192.168.40.3 (192.168.40.3) 56(84) bytes of data.
From 192.168.40.1 icmp_seq=1 Destination Host Unreachable
From 192.168.40.1 icmp_seq=2 Destination Host Unreachable
From 192.168.40.1 icmp_seq=3 Destination Host Unreachable
From 192.168.40.1 icmp_seq=4 Destination Host Unreachable
how to get pinging both side.
Seems like you've been working on this quite a while; six months now, and you haven't followed up in your previous threads about DNS configuration:
https://www.linuxquestions.org/quest...er-4175653421/
https://www.linuxquestions.org/quest...ng-4175663193/
https://www.linuxquestions.org/quest...aa-4175663411/

You need to have a route between servers defined SOMEWHERE. What's your routing table? Since you've been deploying DHCP and DNS for months now, do you have either one working? If so, there should be no need to edit your /etc/hosts file, since you will get such information when you get your DHCP address.
 
Old 11-19-2019, 10:37 AM   #4
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Original Poster
Rep: Reputation: 2
kernek routing table:-in server
Code:
[root@centos75dns centos75]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.40.1    0.0.0.0         UG    100    0        0 ens33
192.168.40.0    0.0.0.0         255.255.255.0   U     100    0        0 ens33
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
in client :-
Code:
[root@centos75client rahul]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.40.1    0.0.0.0         UG    100    0        0 ens33
192.168.40.0    0.0.0.0         255.255.255.0   U     100    0        0 ens33
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
 
Old 11-19-2019, 10:43 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by rahulvishwakarma View Post
kernek routing table:-in server
Code:
[root@centos75dns centos75]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.40.1    0.0.0.0         UG    100    0        0 ens33
192.168.40.0    0.0.0.0         255.255.255.0   U     100    0        0 ens33
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
in client :-
Code:
[root@centos75client rahul]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.40.1    0.0.0.0         UG    100    0        0 ens33
192.168.40.0    0.0.0.0         255.255.255.0   U     100    0        0 ens33
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
And can you ping your gateway from either machine?? And as you were asked before, what have you done for VMware networking??? Do you have bridging enabled? Can you ping ANYTHING? What diagnostics have you done?

And again, what protocol did you use for iptables? ICMP is typically allowed, unless specifically denied...have you tried just turning OFF iptables?? Have you done anything suggested to you in your several other previous threads about DHCP/DNS????
 
Old 11-20-2019, 02:38 AM   #6
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Original Poster
Rep: Reputation: 2
mine default route and dns is : 192.168.40.1 ( centos75dns.db.net ) for client centos75client.db.net( 192.168.40.3). mine VM network in vmnet4 (host only network).subnet ip 192.168.40.0 subnet mask 255.255.255.0. i can ping only self. till yesterday i can ping to server from client . but now it is not pinging. what happened i don't know.

Last edited by rahulvishwakarma; 11-20-2019 at 02:46 AM.
 
Old 11-20-2019, 04:20 AM   #7
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
So, the VM that you can't connect to is your router.

I would perform a quick check to see if anything arrives at centos75dns, e.g.
Code:
tcpdump -i ens33 icmp or arp
then ping it again.

This command reports ICMP packets, including echo requests and replies, and ARP requests and replies at interface ens33.

If nothing arrives, I would check the VMware network setup. If echo or arp requests arrive but no replies are sent, I would check the firewall on centos75dns. If replies are sent, again I would expect something to be wrong with the Vmware network setup.
 
Old 11-20-2019, 05:39 AM   #8
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Original Poster
Rep: Reputation: 2
output is :
Code:
[root@centos75dns rahul]# tcpdump -i ens33 icmp

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ens33, link-type EN10MB (Ethernet), capture size 262144 bytes
cc^C
0 packets captured
0 packets received by filter
0 packets dropped by kernel
[root@centos75dns rahul]# tcpdump -i ens33 arp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ens33, link-type EN10MB (Ethernet), capture size 262144 bytes
^C
0 packets captured
0 packets received by filter
0 packets dropped by kernel
[root@centos75dns rahul]#
 
Old 11-20-2019, 05:48 AM   #9
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Original Poster
Rep: Reputation: 2
after running those command in server now i can ping from server to client via both ip address and hostname, but from client to server only via ipaddress and can not by hostname
Code:
[rahul@centos75client ~]$ ping 192.168.40.3
PING 192.168.40.3 (192.168.40.3) 56(84) bytes of data.
64 bytes from 192.168.40.3: icmp_seq=1 ttl=64 time=0.031 ms
64 bytes from 192.168.40.3: icmp_seq=2 ttl=64 time=0.096 ms
^C
--- 192.168.40.3 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.031/0.063/0.096/0.033 ms
[rahul@centos75client ~]$ ping centos75dns
ping: centos75dns: Name or service not known
by editing /etc/hosts file and adding ip address of server and client it worked. But may i ask " what are those commands after which everything is clear".

now i've second problem : after removing entries from /etc/hosts file from both client and server, cannot ping to eachother.
Code:
[root@centos75client rahul]# ping centos75dns
ping: centos75dns: Name or service not known
i am trying to configure dns on server.

Last edited by rahulvishwakarma; 11-20-2019 at 06:36 AM.
 
Old 11-20-2019, 06:34 AM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by rahulvishwakarma View Post
after running those command in server now i can ping from server to client via both ip address and hostname, but from client to server only via ipaddress and can not by hostname
Code:
[rahul@centos75client ~]$ ping 192.168.40.3
PING 192.168.40.3 (192.168.40.3) 56(84) bytes of data.
64 bytes from 192.168.40.3: icmp_seq=1 ttl=64 time=0.031 ms
64 bytes from 192.168.40.3: icmp_seq=2 ttl=64 time=0.096 ms
^C
--- 192.168.40.3 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.031/0.063/0.096/0.033 ms
[rahul@centos75client ~]$ ping centos75dns
ping: centos75dns: Name or service not known
by editing /etc/hosts file and adding ip address of server and client it worked. But may i ask " what are those commands after which everything is clear".
Sorry, but you don't appear to be reading or responding to things. Is there a reason you can't answer the many questions you've been asked, or follow up in any of your other threads??? You were asked clearly:
  • How you configured networking in the VMWare systems
  • If you had bridging enabled
  • What protocols you allowed in IP tables
  • If you tried turning off IP tables totally
  • If you could ping your gateway from either system
..and you answered none of those questions.

You say "after running those command"...but don't actually tell us WHAT commands you ran. And for someone who's been working on DNS and DHCP for SEVEN MONTHS now, it's odd that you don't understand what DNS or DHCP actually do, or why adding things to the /etc/hosts file (which you were told about previously, but ignored), will make things work. Glad you made progress, but if you're not going to participate in a conversation, answer questions or even provide clear steps/questions of your own, there is not much point in posting.
 
Old 12-09-2019, 08:16 AM   #11
rahulvishwakarma
Member
 
Registered: Aug 2010
Posts: 138

Original Poster
Rep: Reputation: 2
i solved problem as follows:-
mine /etc/named.conf is :-
Code:
options {
	listen-on port 53 { 127.0.0.1; 192.168.60.1; };
#	listen-on-v6 port 53 { ::1; };
	directory 	"/var/named";
	dump-file 	"/var/named/data/cache_dump.db";
	statistics-file "/var/named/data/named_stats.txt";
	memstatistics-file "/var/named/data/named_mem_stats.txt";
	allow-query     { localhost; 192.168.60.0/24; };
	recursion yes;
	dnssec-enable yes;
	dnssec-validation yes;
	/* Path to ISC DLV key */
	bindkeys-file "/etc/named.iscdlv.key";
	managed-keys-directory "/var/named/dynamic";
	pid-file "/run/named/named.pid";
	session-keyfile "/run/named/session.key";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
	type hint;
	file "named.ca";
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

zone "db.net" IN {

	type master;
	file "db.forward.zone";
	allow-update { none; };
};

zone "60.168.192.in-addr.arpa" IN {

	type master;
	file "db.reverse.zone";
	allow-update { none; };
};
mine /var/named/db.forward.zone is:-

Code:
$TTL 1D
@	IN SOA	db.net. admin.db.net. (
					2019112901; serial
					1D	; refresh
					1H	; retry
					1W	; expire
					3H )	; minimum
@		IN	NS	server75.db.net.
@		IN	A	192.168.60.1

server75	IN	A	192.168.60.1
serverora11gr2	IN	A	192.168.60.2
centos6client	IN	A	192.168.60.3
centos7client	IN	A	192.168.60.4

server5		IN	A	192.168.60.5
server6 	IN	A	192.168.60.6
and reverse zone file is :-
Code:
$TTL 1D
@	IN SOA	db.net. admin.db.net. (
					2019112901; serial
					1D	; refresh
					1H	; retry
					1W	; expire
					3H )	; minimum
@		IN	NS	server75.db.net.
@		IN	PTR	db.net.

1		IN	PTR	server75.db.net.
2		IN	PTR	serverora11gr2.db.net.
3		IN	PTR 	centos6client.db.net.
4		IN	PTR	centos7client.db.net.

5		IN	PTR	server5.db.net.
6		IN	PTR	server6.db.net.
on client side
/etc/resolv.conf is :-
Code:
# Generated by NetworkManager
search db.net
nameserver 192.168.60.1
now problem is solved
after running dig commnad in client :-
Code:
[rahul@centos7client software]$ dig server75.db.net

; <<>> DiG 9.9.4-RedHat-9.9.4-61.el7 <<>> server75.db.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19053
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;server75.db.net.		IN	A

;; ANSWER SECTION:
server75.db.net.	86400	IN	A	192.168.60.1

;; AUTHORITY SECTION:
db.net.			86400	IN	NS	server75.db.net.

;; Query time: 0 msec
;; SERVER: 192.168.60.1#53(192.168.60.1)
;; WHEN: Mon Dec 09 19:42:38 IST 2019
;; MSG SIZE  rcvd: 74
now problem is solved thanks to all of your good advice.
 
  


Reply

Tags
centos7



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] CANT PING VM from client cpu BUT CAN PING CLIENT FROM VM cajunchief Linux - Networking 1 01-26-2016 10:43 PM
[SOLVED] Server can ping clients, but clients cannot ping server and i cannot SSH into Server jzakharia Linux - Networking 5 07-05-2015 02:21 PM
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 02:39 PM
openvpn client can ping server, server cannot ping client psycroptic Linux - Networking 0 10-12-2012 08:42 PM
I cannot ping with command 'ping IP' address but can ping with 'ping IP -I eth0' sanketmlad Linux - Networking 2 07-15-2011 05:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration