Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 460C1781AA1 for <~alpine/users@lists.alpinelinux.org>; Sun, 21 Feb 2021 17:04:00 +0000 (UTC) Received: by mail-ej1-f41.google.com with SMTP id do6so25475590ejc.3 for <~alpine/users@lists.alpinelinux.org>; Sun, 21 Feb 2021 09:04:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MQz7gXVT6xzQpODh2OGkB3DKnb4w2i6fKC1Fa4DcoM0=; b=Rr/0riHb7SqiZiI714b7Hbtj5njm6x5rP0qdGTL1XyDNhUKfwXmg+rPJP1xxudGQEX +VkJoDdTowzIso/cYRE2JrXmdNwe/6NvvugkEAfF4qHGnaqLvgxs8b9HNDf3uXxDM0Ui ZUZ7lFF3nFzlrWEn3/G4EZPzKvnuGt8heTqnZ44QnNkxhUOcrJtZ2jP3hSE/cCBvdsYI /HjVpCKsaUpa3sPnU5VAC49nk7BNjWepDATDBTgr/EdG9YylUSl9/rLxyzaNoeUQMtZW XwKXtW4mmX/JPYKH0yQg8jhosGEzmMT2CXO/vBpeJjKDVi7ayXRpVOAHSBJRALmkadeF HweA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MQz7gXVT6xzQpODh2OGkB3DKnb4w2i6fKC1Fa4DcoM0=; b=CiBHYhlgSnpjA3ofBBl5IdCzDjl8nrtOmxVtg5OLiNxZJkps4O0zfpjBXm2uo0FJ9o BFO9L9LrV0NTC7qYWS28p5zmheS/2d185GquuX09CxXAHZLHB6IWVvwJ8nOBdQ0wdIUw 11zTaH0wIbpBkDjZUrfkFuGyvB3YB15kw69Pee1qnHcTdZ1FiR9kGwiACSLVnbT8BYn4 oehZUmyB17BSN3TUad/i4JZdTrLdI3yBLMuPUfErOaPLQ+PcGb3AXrdxEH6BqpcjS8MB InQn6fNUP3Ve7V4YSQ1xizsVrcGd9FkNdvPQZIFP3FP7KIzHobuToCjaIOHlC9ozu6Xg PnWA== X-Gm-Message-State: AOAM532rvwuNsNN0dhXQSjoM18QHUhB6VjcJd3CmwjuRmhqrhh/mpvIM 6MCoyKo64NFZfm5NzYQlPcDpKYI9CPed+4U9/HQpmj1sk/w= X-Google-Smtp-Source: ABdhPJwhq9xlKdJmHMdrXDSCnE50lh5AID0COf+fOzQRGDfUOACc0XnvZEsgegD5ifaC0zUX1l03dE1gSDEUpduy+vY= X-Received: by 2002:a17:907:2113:: with SMTP id qn19mr17097763ejb.98.1613927039806; Sun, 21 Feb 2021 09:03:59 -0800 (PST) MIME-Version: 1.0 References: <229c8ae0-9566-3fad-e5b9-b63173847b98@riseup.net> In-Reply-To: From: Banibrata Dutta Date: Sun, 21 Feb 2021 22:33:48 +0530 Message-ID: Subject: Re: Orig eth0 was bridged, changed to NAT, but dhcp not working To: donoban Cc: ~alpine/users@lists.alpinelinux.org Content-Type: multipart/alternative; boundary="000000000000e6aea905bbdbabe4" --000000000000e6aea905bbdbabe4 Content-Type: text/plain; charset="UTF-8" Thanks much. Yes, the regular NAT mode is now working fine (chose the paravirtualized-network i.e. 'virtio-net' driver). The trick (seems rather obvious, come to think of it) is to have the VPN tunnel setup prior to starting the VM. What doesn't seem to work (or at least didn't in my case) is to setup the VPN tunnel in the host, after the VM is already up and running. In the latter case, doing a restart of the networking service doesn't help. Also, I had to manually add the VPN-server specific DNS servers, in the resolv.conf. Right now struggling to add the private root-CA certificates for a remote lab network, reachable only over this VPN. On Sun, Feb 21, 2021 at 9:31 PM donoban wrote: > On 2/21/21 3:40 PM, Banibrata Dutta wrote: > > Looks like I wasn't very clear. I wasn't referring to a VPN server on > > host, but a VPN endpoint on the host, setup by the VPN client running on > > host. > > The VPN server is remote. > > > > So do you have some interface like 'tun0' on your host?. Is this > interface acting as default gateway for your host? In that case NAT mode > should work fine and dhcp too. After reconfiguring the interface did you > reload id (ifdown/ifup) or tried to reboot? When you used bridge mode > your DCHP server was the same for your host and guest, probably a > physical router, switching to NAT your host is acting as DCHP server for > your guest using VirtualBox, maybe some VirtualBox is not elabled, or > something is blocking dhcp request. Also you can try to setup manually: > > "In NAT mode, the guest network interface is assigned to the IPv4 range > 10.0.x.0/24 by default where x corresponds to the instance of the NAT > interface +2. So x is 2 when there is only one NAT instance active. In > that case the guest is assigned to the address 10.0.2.15, the gateway is > set to 10.0.2.2 and the name server can be found at 10.0.2.3." [1] > > Try using IP 10.0.2.15/255.255.255.0, gateway 10.0.2.2 and name server > 10.0.2.3 > > Another alternative could be using bridge mode but I am not sure if it > will be properly supported by the tunneling layer. Probably using NAT > you can achieve what you need. > > > [1] > > https://docs.oracle.com/en/virtualization/virtualbox/6.0/admin/changenat.html > > -- regards, Banibrata http://www.linkedin.com/in/bdutta http://twitter.com/edgeliving --000000000000e6aea905bbdbabe4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks much.

Yes, the r= egular NAT mode is now working fine (chose the paravirtualized-network i.e.= 'virtio-net' driver).

The trick (see= ms rather obvious, come to think of it) is to have the VPN tunnel setup pri= or to starting the VM. What doesn't seem to work (or at least didn'= t in my case) is to setup the VPN tunnel in the host, after the VM is alrea= dy up and running. In the latter case, doing a restart of the networking se= rvice doesn't help. Also, I had to manually add the VPN-server specific= DNS servers, in the resolv.conf.

Right now strugg= ling to add the private root-CA certificates for a remote lab network, reac= hable only over this VPN.

On Sun, Feb 21, 2021 at 9:31 PM donoban = <donoban@riseup.net> wrote:=
On 2/21/21 3:40= PM, Banibrata Dutta wrote:
> Looks like I wasn't very clear. I wasn't referring to a VPN se= rver on
> host, but a VPN endpoint on the host, setup by the VPN client running = on
> host.
> The VPN server is remote.
>

So do you have some interface like 'tun0' on your host?. Is this interface acting as default gateway for your host? In that case NAT mode should work fine and dhcp too. After reconfiguring the interface did you reload id (ifdown/ifup) or tried to reboot? When you used bridge mode
your DCHP server was the same for your host and guest, probably a
physical router, switching to NAT your host is acting as DCHP server for your guest using VirtualBox, maybe some VirtualBox is not elabled, or
something is blocking dhcp request. Also you can try to setup manually:

"In NAT mode, the guest network interface is assigned to the IPv4 rang= e
10.0.x.0/24 by default where x corresponds to the instance of the NAT
interface +2. So x is 2 when there is only one NAT instance active. In
that case the guest is assigned to the address 10.0.2.15, the gateway is set to 10.0.2.2 and the name server can be found at 10.0.2.3." [1]

Try using IP 10.0.2.15/255.255.255.0, gateway 10.0.2.2=C2=A0 and n= ame server
10.0.2.3

Another alternative could be using bridge mode but I am not sure if it
will be properly supported by the tunneling layer. Probably using NAT
you can achieve what you need.


[1]
https://docs.oracle.com= /en/virtualization/virtualbox/6.0/admin/changenat.html



--
--000000000000e6aea905bbdbabe4--