Hi Robert, I was trying from the global zone and with forwarding enabled. But I was mapping using the wrong interface. All good now.
Thanks for your help, > Sent: Sunday, February 05, 2017 at 7:47 PM > From: "Robert Mustacchi" <r...@joyent.com> > To: smartos-discuss@lists.smartos.org > Subject: Re: [smartos-discuss] nat for vm and port redirection > > On 2/5/17 4:21 , rafael barros wrote: > > Hi Guys, > > After a bit of struggle, I was able to install SmartOS and make it boot > > with a > > public and a private IP. > > Now I am trying to provide internet to my virtual machine and I can't get > > the > > NAT working. > > Are you trying to run the NAT from the global zone or a non-global zone? > Have you enabled forwarding (look at routeadm(1M))? > > Robert > > > From the Headnode, I can ping google and I can ping my internal KVM-box. > > My headnode has 2 nics: > > private - bge0 - 10.1.8.12 > > public - external0 - 67.xx.xx.xx > > # dladm show-link > > LINK CLASS MTU STATE BRIDGE OVER > > bge0 phys 1500 up -- -- > > bge1 phys 1500 up -- -- > > external0 vnic 1500 up -- bge1 > > stub0 etherstub 9000 up -- -- > > net0 vnic 1500 ? -- bge0 > > net1 vnic 1500 ? -- stub0 > > The routing looks like this: > > # netstat -rn > > Routing Table: IPv4 > > Destination Gateway Flags Ref Use Interface > > -------------------- -------------------- ----- ----- ---------- --------- > > default 67.xx.xx.xx UG 4 379108 external0 > > 10.1.8.0 10.1.8.12 U 7 15090 bge0 > > 67.xx.xx.xx 67.xx.xx.xx U 5 27 external0 > > 127.0.0.1 127.0.0.1 UH 2 1116 lo0 > > > > I have a KVM running linux with 2 interfaces: > > net0 - 10.1.8.15 > > net1 - 172.16.1.1 > > the routing table looks like this: > > $ route -n > > Kernel IP routing table > > Destination Gateway Genmask Flags Metric Ref Use > > Iface > > 0.0.0.0 10.1.8.12 0.0.0.0 UG 0 0 0 net0 > > 10.1.8.0 0.0.0.0 255.255.255.0 U 0 0 0 net0 > > 172.16.1.0 0.0.0.0 255.255.255.0 U 0 0 0 net1 > > From this Box, I can ping the 10.1.8.12 and viceversa, but I can't reach > > internet. > > I would also like to redirect the port 443 on the headnode to the internal > > KVM > > as follows: > > https://67.xx.xx.xx > > <https://deref-mail.com/mail/client/8JKpIdk2cbg/dereferrer/?redirectUrl=https%3A%2F%2F67.xx.xx.xx> > > > > => 10.1.8.15:443 > > I have tried different options for /etc/ipf/ipnat.conf, but I am not > > getting it. > > Any directions how I could achieve this? > > Thank you > > Rafael > > *smartos-discuss* | Archives > > <https://www.listbox.com/member/archive/184463/=now> > > <https://www.listbox.com/member/archive/rss/184463/21483261-4b78dd38> | > > Modify > > <https://www.listbox.com/member/?&> > > Your Subscription [Powered by Listbox] <http://www.listbox.com> > > > > ------------------------------------------- smartos-discuss Archives: https://www.listbox.com/member/archive/184463/=now RSS Feed: https://www.listbox.com/member/archive/rss/184463/25769125-55cfbc00 Modify Your Subscription: https://www.listbox.com/member/?member_id=25769125&id_secret=25769125-7688e9fb Powered by Listbox: http://www.listbox.com