LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-18-2018, 01:35 AM   #1
sanjibukai
LQ Newbie
 
Registered: May 2018
Posts: 3

Rep: Reputation: Disabled
Weird dns issue when SSHing with git push


Hi everybody,

I have a weird issue I cannot figure out..
I have a git repository with an origin remote to some url (eg.
Code:
git@example.com
)
When I make a ping request
Code:
ping example.com
I receive the response with the actual IP address..
However when I try to SSH (or even when I try to git push) I get the following error:
Code:
ssh: connect to host 172.17.0.2 port 22: No route to host
ssh_exchange_identification: Connection closed by remote host
I don't know why I got that private IP?
As I said, the ping works with the actual IP..
In an another PC on my LAN I don't have this problem.

How can I troubleshot this issue?

I am running manjaro in a virtualbox
 
Old 05-18-2018, 01:14 PM   #2
/dev/random
Member
 
Registered: Aug 2012
Location: Ontario, Canada
Distribution: Slackware 14.1, LFS-current, NetBSD 6.1.3
Posts: 278

Rep: Reputation: 104Reputation: 104
Quote:
Originally Posted by sanjibukai View Post
Hi everybody,

I have a weird issue I cannot figure out..
I have a git repository with an origin remote to some url (eg.
Code:
git@example.com
)
When I make a ping request
Code:
ping example.com
I receive the response with the actual IP address..
However when I try to SSH (or even when I try to git push) I get the following error:
Code:
ssh: connect to host 172.17.0.2 port 22: No route to host
ssh_exchange_identification: Connection closed by remote host
I don't know why I got that private IP?
As I said, the ping works with the actual IP..
In an another PC on my LAN I don't have this problem.

How can I troubleshot this issue?

I am running manjaro in a virtualbox
When you git push is the remote origin a ip address or a dns name?
From the little output shown, it seems your box got its arp cache poisoned somehow.
 
Old 05-18-2018, 02:08 PM   #3
sanjibukai
LQ Newbie
 
Registered: May 2018
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hi,
Here is the output of my remote list:
Code:
origin git@example.com:project (fetch)
origin git@example.com:project (push)
When I do a git push I got the previous error message where the host is replaced by that IP address..
Code:
ssh: connect to host 172.17.0.2 port 22: No route to host
However, when I do a ping or even an nslookup I got the real IP address as it should be:
Code:
> nslookup example.com

Server:		192.168.0.1
Address:	192.168.0.1#53

Non-authoritative answer:
Name:	example.com
Address: 75.126.162.205

> ping example.com

PING example.com (75.126.162.205) 56(84) bytes of data.
In both these cases I got my real IP..

How can I check (reset) the arp cache ?

Edit:
I found this link https://www.orionscache.com/2014/01/...ache-in-linux/
When I listed the arp cache at first I got this:
Code:
>arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.0.1              ether   18:d6:c7:xx:xx:xx   C                     enp0s3
172.17.0.3               ether   02:42:ac:xx:xx:x3   C                     docker0
172.17.0.2               ether   02:42:ac:xx:xx:x2   C                     docker0
Then I flushed the cache and I got one line deleted:
Code:
>ip -s -s neigh flush all
..
..
*** Round 1, deleting 5 entries ***
*** Flush is complete after 1 round ***
>arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.0.1              ether   18:d6:c7:xx:xx:xx   C                     enp0s3
172.17.0.2               ether   02:42:ac:xx:xx:x2   C                     docker0
But the result stay the same...
And in fact, that weird address has to do with docker?
I don't know why...

Edit 2:
Also, since I'm running arch (manjaro), it seems I don't have a dns cache..

Last edited by sanjibukai; 05-18-2018 at 02:24 PM.
 
Old 05-18-2018, 03:13 PM   #4
/dev/random
Member
 
Registered: Aug 2012
Location: Ontario, Canada
Distribution: Slackware 14.1, LFS-current, NetBSD 6.1.3
Posts: 278

Rep: Reputation: 104Reputation: 104
Quote:
Originally Posted by sanjibukai View Post
Hi,
Here is the output of my remote list:
Code:
origin git@example.com:project (fetch)
origin git@example.com:project (push)
When I do a git push I got the previous error message where the host is replaced by that IP address..
Code:
ssh: connect to host 172.17.0.2 port 22: No route to host
However, when I do a ping or even an nslookup I got the real IP address as it should be:
Code:
> nslookup example.com

Server:		192.168.0.1
Address:	192.168.0.1#53

Non-authoritative answer:
Name:	example.com
Address: 75.126.162.205

> ping example.com

PING example.com (75.126.162.205) 56(84) bytes of data.
In both these cases I got my real IP..

How can I check (reset) the arp cache ?

Edit:
I found this link https://www.orionscache.com/2014/01/...ache-in-linux/
When I listed the arp cache at first I got this:
Code:
>arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.0.1              ether   18:d6:c7:xx:xx:xx   C                     enp0s3
172.17.0.3               ether   02:42:ac:xx:xx:x3   C                     docker0
172.17.0.2               ether   02:42:ac:xx:xx:x2   C                     docker0
Then I flushed the cache and I got one line deleted:
Code:
>ip -s -s neigh flush all
..
..
*** Round 1, deleting 5 entries ***
*** Flush is complete after 1 round ***
>arp -n
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.0.1              ether   18:d6:c7:xx:xx:xx   C                     enp0s3
172.17.0.2               ether   02:42:ac:xx:xx:x2   C                     docker0
But the result stay the same...
And in fact, that weird address has to do with docker?
I don't know why...

Edit 2:
Also, since I'm running arch (manjaro), it seems I don't have a dns cache..
What happens when you do the following:
Code:
origin git@75.126.162.205:project (fetch)
origin git@75.126.162.205:project (push)
Also what is the output of:
Code:
 route -n

Last edited by /dev/random; 05-18-2018 at 03:16 PM.
 
Old 05-18-2018, 09:35 PM   #5
sanjibukai
LQ Newbie
 
Registered: May 2018
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hello again,
Indeed, replacing the remote with the IP worked (as SSHing using the IP).
Should be some weird DNS issue then..

The output of the route is:
Code:
>route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.1     0.0.0.0         UG    100    0        0 enp0s3
172.17.0.0      0.0.0.0         255.255.0.0     U     0      0        0 docker0
192.168.0.0     0.0.0.0         255.255.255.0   U     100    0        0 enp0s3

Last edited by sanjibukai; 05-18-2018 at 09:37 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
git svn - how to push svn information to another git repo eantoranz Programming 1 06-23-2015 11:08 AM
[SOLVED] git push in a git-init without --bare option? xeon123 Linux - Newbie 1 06-27-2011 03:44 AM
Weird DNS Issue Jamesk5 Linux - Server 17 06-06-2007 11:33 PM
weird DNS related (?) issue bobcat Linux - Networking 1 06-10-2002 08:08 PM
really weird DNS issue. Help needed ASAP! Supp0rtLinux Linux - Networking 2 05-20-2002 10:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:18 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration