netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Issue with /etc/netns/${nsname}/hosts
@ 2015-09-01 23:23 James Loosli
  2015-09-02 16:24 ` Nicolas Dichtel
  0 siblings, 1 reply; 2+ messages in thread
From: James Loosli @ 2015-09-01 23:23 UTC (permalink / raw)
  To: netdev

I seem to have an issue with using namespace-specific hosts files.
Here's an example.

I have different entries for foo.com in my hosts file for the
namespace and the system-wide hosts file;

root@server-01 Tue Sep 01 04:15:02pm
> cat /etc/netns/nsXX-XXX-240-3/hosts | grep foo
1.2.3.4 foo.com
root@server-01 Tue Sep 01 04:15:15pm
> ip netns exec nsXX-XXX-240-3 cat /etc/hosts | grep foo
1.2.3.4 foo.com
root@server-01 Tue Sep 01 04:15:19pm
> cat /etc/hosts | grep foo
0.0.0.0 foo.com

But when I try to get curl, ping or other utilities to use that hosts
file entry, they ignore the namespace-specific file.

root@server-01 Tue Sep 01 04:16:02pm
> ip netns exec ns91-227-240-3 curl -vv foo.com
* About to connect() to foo.com port 80 (#0)
*   Trying 0.0.0.0...
* Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host
root@server-01 Tue Sep 01 04:16:08pm
> curl -vv foo.com
* About to connect() to foo.com port 80 (#0)
*   Trying 0.0.0.0...
* Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host

Not sure what I'm doing wrong, but this behavior seems to contradict
what I find in the manpages for iproute2 and netns /etc files. Could
this be permissions related?

Regards,

James Loosli
949.439.6109
loosli@gmail.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Issue with /etc/netns/${nsname}/hosts
  2015-09-01 23:23 Issue with /etc/netns/${nsname}/hosts James Loosli
@ 2015-09-02 16:24 ` Nicolas Dichtel
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Dichtel @ 2015-09-02 16:24 UTC (permalink / raw)
  To: James Loosli, netdev

Le 02/09/2015 01:23, James Loosli a écrit :
> I seem to have an issue with using namespace-specific hosts files.
> Here's an example.
>
> I have different entries for foo.com in my hosts file for the
> namespace and the system-wide hosts file;
>
> root@server-01 Tue Sep 01 04:15:02pm
>> cat /etc/netns/nsXX-XXX-240-3/hosts | grep foo
> 1.2.3.4 foo.com
> root@server-01 Tue Sep 01 04:15:15pm
>> ip netns exec nsXX-XXX-240-3 cat /etc/hosts | grep foo
> 1.2.3.4 foo.com
> root@server-01 Tue Sep 01 04:15:19pm
>> cat /etc/hosts | grep foo
> 0.0.0.0 foo.com
>
> But when I try to get curl, ping or other utilities to use that hosts
> file entry, they ignore the namespace-specific file.
>
> root@server-01 Tue Sep 01 04:16:02pm
>> ip netns exec ns91-227-240-3 curl -vv foo.com
Probably a copy and paste error, but the netns name was nsXX-XXX-240-3 in your
example above.
Can you confirm?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-02 16:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-01 23:23 Issue with /etc/netns/${nsname}/hosts James Loosli
2015-09-02 16:24 ` Nicolas Dichtel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).