Estou no OS X El Capitain 10.11.5.
Tentando executar o servidor da Web localmente e conceder acesso de algum lugar fora.
Para ter acesso à Internet eu uso wifi spot.
O firewall não está disponível no meu computador Mac.
ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=1<PERFORMNUD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether f4:5c:89:90:96:7d
inet6 fe80::f65c:89ff:fe90:967d%en0 prefixlen 64 scopeid 0x4
inet 10.37.44.92 netmask 0xfffffc00 broadcast 10.37.47.255
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 6a:00:01:80:39:90
media: autoselect <full-duplex>
status: inactive
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
options=60<TSO4,TSO6>
ether 6a:00:01:80:39:91
media: autoselect <full-duplex>
status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
ether 06:5c:89:90:96:7d
media: autoselect
status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
ether 9a:46:fc:f3:8c:a2
inet6 fe80::9846:fcff:fef3:8ca2%awdl0 prefixlen 64 scopeid 0x8
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=63<RXCSUM,TXCSUM,TSO4,TSO6>
ether f6:5c:89:09:14:00
Configuration:
id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
ipfilter disabled flags 0x2
member: en1 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 5 priority 0 path cost 0
member: en2 flags=3<LEARNING,DISCOVER>
ifmaxaddr 0 port 6 priority 0 path cost 0
nd6 options=1<PERFORMNUD>
media: <unknown type>
status: inactive
vboxnet0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
ether 0a:00:27:00:00:00
inet 192.168.99.1 netmask 0xffffff00 broadcast 192.168.99.255
Como você pode ver o endereço IP do meu computador dentro da rede wifi é 10.37.44.92
Ao mesmo tempo, o Google mostra que meu IP público é 77.88.196.39
É assim que eu executo o servidor web:
dmac:solidus-sample dob$ rails s -p 3001
=> Booting WEBrick
=> Rails 4.2.7 application starting in development on http://localhost:3001
=> Run 'rails server -h' for more startup options
=> Ctrl-C to shutdown server
[2016-08-09 15:32:15] INFO WEBrick 1.3.1
[2016-08-09 15:32:15] INFO ruby 2.2.4 (2015-12-16) [x86_64-darwin15]
[2016-08-09 15:32:15] INFO WEBrick::HTTPServer#start: pid=16366 port=3001
Eu gostaria de ter acesso ao meu servidor da web pelo link . Mas agora não está acessível.
O que eu fiz?
Quando executo o servidor da Web dessa maneira (a tecla -b significa vinculação):
rails s -p 3001 -b 10.37.44.92
Eu posso acessar http://10.37.44.92:3001
de qualquer computador dentro da mesma rede Wi-Fi.
Mas nenhum acesso bem-sucedido ao servidor da Web pela Internet.
Obrigado.