Thanks for posting that blog. You can actually use a shell provisioner to
run a script using the two route commands needed to change the default
gateway.

It's solved a problem where I could join a NIS domain but the automounter
never worked because of the default gateway going throgh the nat interface.

Mike

On Tue, Sep 23, 2014 at 1:42 AM, Alvaro Miranda Aguilera <[email protected]>
wrote:

> yeah, for the 2nd part the issue is the default gw is always on the nat
> network, so the real ip/traffic is nto being routed.
>
> a hack could be put into a init script or /etc/rc.local if exists
> something manual.
>
> check this post for ideas:
>
>
> http://enginx.com/blog/vagrant-networking-enable-internet-accessible-machine-setup/
>
> hope this helps.
>
>
> On Tue, Sep 23, 2014 at 4:25 AM, <[email protected]> wrote:
>
>> I tried to forward wan traffic directly to the host. ie:
>>
>> *router*: forward TCP port 80 to host 10.1.10.25:8080
>>
>> *vagrant*:
>>
>> Vagrant.configure("2") do |config|
>>   config.vm.network "forwarded_port", guest: 80, host: 8080
>> end
>>
>> http traffic is being served, but still logging host ip as real ip.
>>
>>
>> I also tried setting vagrant as public network, but for some reason it is 
>> not responding to traffic from internet.
>>
>> *router:* forward TCP port 80 to 10.1.10.36:80
>> *Vagrant:*
>> Vagrant.configure("2") do |config|
>>   config.vm.network "public_network", ip: "10.1.10.36"
>> end
>>
>> http request from host or another computer on the local network are being
>> served with their IP as real IP, but external (internet) traffic did wasn't
>> served.
>>
>> Any thoughts?
>>
>>
>>
>> On Wednesday, September 17, 2014 11:51:35 PM UTC-4, Alvaro Miranda
>> Aguilera wrote:
>>>
>>> Not sure if will work but you can test without that pfctl part.
>>>
>>> - wan -> port 8080
>>>
>>> or
>>>
>>> guest 80 to host 80
>>>
>>> if none of those works, then you could look into assign an ip of the
>>> network and use public/bridge networking.
>>>
>>> Alvaro.
>>>
>>> On Thu, Sep 18, 2014 at 3:36 PM, <[email protected]> wrote:
>>>
>>>> Is it possible to collect the real ip of the visitor address when the
>>>> vagrant box is configured as follow:
>>>> I have a vagrant box setup without private or public network. (I guess
>>>> this is host-only network?)
>>>> nginx is running on port 80 which is forwarded to 8080 on the host. At
>>>> the host, I have pfctl forward port 80 to 8080.
>>>> I have the router to forward port 80 on the wan port to port 80 on the
>>>> host.
>>>> External visitor can see the website (nginx), but the ip that's being
>>>> logged is not the real ip address of the visitor.
>>>>
>>>> cheers,
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Vagrant" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Vagrant" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to