Hi,
sorry, my bad!
On Ubuntu python's stdlib socket.gethostbyname return 127.0.1.1 NOT
127.0.0.1
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostbyname(socket.gethostname())
'127.0.1.1'
It will cause the connect fail on Ubuntu, but Mac OS X can work normally
Python 2.7.8 (default, Aug 24 2014, 21:26:19)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostbyname(socket.gethostname())
'192.168.111.105'
I tried to bind(('0.0.0.0', port)) but it return 127.0.0.1 either Mac OS X
or Ubuntu.
Remote client (Snort machine side) can't connect to 127.0.0.1.
I also found another way to get host IP but need additional installs
package netifaces. (https://pypi.python.org/pypi/netifaces)
Or, maybe let someone config controller IP address in applications?
Che-Wei Lin <http://about.me/linton.tw>, John Lin
Institute of Communication Engineering,
National Tsing Hua University
[image: 林哲緯 on about.me]
E-mail: [email protected]
Blog: blog.linton.tw
Mobile: +886-952-301-269
On Sun, Sep 7, 2014 at 3:44 PM, FUJITA Tomonori <
[email protected]> wrote:
> Hi,
>
> On Sun, 7 Sep 2014 15:34:02 +0800
> Che-Wei Lin <[email protected]> wrote:
>
> > I fixed some trivial minor bug and corrected some typos in the document.
> >
> > I found that when i want to get the REAL IP.
> > The old version used on Ubuntu python's stdlib socket.gethostbyname
> return
> > 127.0.0.1.
>
> I guess that a host can have multiple real IP addresses and 127.0.0.1
> is one of them.
>
> If I understand your code correctly, you try to connect to 8.8.8.8 and
> use the address to access to 8.8.8.8 for binding a listen port. I'm
> not sure if it is a good idea because:
>
> 1) A host could not access to the internet (8.8.8.8) due to many
> reasons (firewall, etc).
>
> 2) Even a host can, the address for accessing to the Internet is not
> appropriate for a listen port for this application.
>
> Why not?
>
> bind(('0.0.0.0', port))
>
> > This patch I am using another way to get the real IP
>
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel