[SOLVED] cannot ping from server to client but can ping from client to server.
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 :-
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
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:
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
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.
[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????
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.