Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1274225pxb; Thu, 4 Mar 2021 07:32:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJySG1NatUZxyfyPISZZHP1jEmHWVRziz5cENG22CUxs5OEE5nYew1y33tpgcri5y1FF0GXi X-Received: by 2002:a17:907:971a:: with SMTP id jg26mr3391385ejc.317.1614871959875; Thu, 04 Mar 2021 07:32:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614871959; cv=none; d=google.com; s=arc-20160816; b=prCKbQNndWAYlqPEis8ylUosGMicyXNd/8jqnBeDwD7dKrVnQom06O/Rg6Ecw/f8Q3 4K0M2xVvcE3a6YNkRZ/kXmNI5MZROgXL0uvOeqzPGMS9/gp22cp6nuItwcNh19zg1IdB 0xz+VQQ4ut9IK6sfg8RWLG5cwOxiDRc1eKJydDn/l7auq7sOBdnzTKaHNN6P0+7IVoyA X/PxMVbeK8Z1EKyWm2Ma0JCv73cAwQwZzRpU1Snc04BPap8yzE107MEFpS6NNHwsVoS2 B/QRnsA378abw4SIAPRw/S/EGarL4X8B5LdmoNopQBpRSuZ5HZJVjP2OMBgzEqCOng4v Jm3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:to:from:subject:message-id; bh=9PXqr00pSJSlvysqYCJKAFjYfrl18z3yWJ2RfxCGx3Q=; b=EJ628v9lQiJ1wxEWCI1aMqCT7NYTpJP57w1b0JjZngCWEBKSF94JNr03sVJ4x65Gx6 kkkyn4/uLXGVfxHY+LiTz8D2+j0RcKimp4Qpjwr3xNvDZJR3HQsbcoCO+6N7sOIzZFAU QRYhRqg53P0p/th3Pk9gxEoUKI006i/iErUucGjZ8n5qCpjj6vV9pw9fOknFRPNnbg32 kgenjKFtVPJKXT2uoFXeyKkqiqRM3MafekgNGgHy/+eJ3CaCBuDu2r985Op/femvgExI KyGXot7sXGg+GS4ShN+JUeTSpRgMb8s4VteruI82s8qSZuxdWAr6qMYpRRfbXOVa0tLM cacw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x27si16874588ejb.603.2021.03.04.07.32.15; Thu, 04 Mar 2021 07:32:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236729AbhCDI1J (ORCPT + 99 others); Thu, 4 Mar 2021 03:27:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236725AbhCDI0v (ORCPT ); Thu, 4 Mar 2021 03:26:51 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7D35C061756 for ; Thu, 4 Mar 2021 00:26:10 -0800 (PST) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94) (envelope-from ) id 1lHjJA-00BXy0-Am; Thu, 04 Mar 2021 09:26:08 +0100 Message-ID: Subject: Re: bridge mac80211_hwsim AP to internet? From: Johannes Berg To: Joshua Zhao , linux-wireless@vger.kernel.org Date: Thu, 04 Mar 2021 09:26:07 +0100 In-Reply-To: (sfid-20210304_021016_482226_92E625AC) References: (sfid-20210304_021016_482226_92E625AC) Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-malware-bazaar: not-scanned Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, 2021-03-03 at 16:06 -0800, Joshua Zhao wrote: > Hi, > I'm using mac80211_hwsim to simulate a virtual STA and a virtual AP. > How can I bridge the virtual AP to a backhaul link on my PC (e.g. a > physical ethernet link) for real internet connection? i.e. so that my > virtual STA can access the internet. The AP could be configured in > NAT mode or layer-2 bridge mode. Is it possible/supported? Just like on a normal AP? Create a bridge interface (e.g. brctl) and add the AP and backhaul interface to it. Use IP assignment etc. on the bridge and configure hostapd accordingly to know about it. johannes