From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7912 invoked from network); 9 Dec 2020 07:00:42 -0000 Received: from tb-ob21.topicbox.com (173.228.157.67) by inbox.vuxu.org with ESMTPUTF8; 9 Dec 2020 07:00:42 -0000 Received: from tb-mx1.topicbox.com (tb-mx1.nyi.icgroup.com [10.90.30.61]) by tb-ob21.topicbox.com (Postfix) with ESMTP id D3D821DCD3 for ; Wed, 9 Dec 2020 02:00:39 -0500 (EST) (envelope-from bounce.mM091abcc56de424937ea9b136.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx1.topicbox.com (Postfix, from userid 1132) id 99F13C7DAB9; Wed, 9 Dec 2020 02:00:39 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=from:to :subject:message-id:references:in-reply-to:date:mime-version :content-type:content-transfer-encoding:list-help:list-id :list-post:list-subscribe:reply-to:list-unsubscribe; s=dkim-1; bh=RYJYlhTMIuMQ1T9pb9zLnAvtMsbm6HDAhRXU1BEsMRw=; b=lS0hUcaF/XAq jqku5l+A0noSe7nokfdQcERUrjkJWHaD1NHYdSdrN9Cs1jJKTrWc5Xt7CT1GcELS OP29xL0UWINQ4+lfBSjDDkgOcgkgLkwMt90kYfVorjK4XBuSvpVyAR2K7UcwogGH yNIphBtYwHdJvyLQIwKP8bTRGi+rIVs= From: remywang@cs.washington.edu To: 9fans <9fans@9fans.net> Subject: Re: [9fans] Raw ethernet on 9vx Message-Id: <16074972350.fF34.73931@composer.9fans.topicbox.com> References: <16073224010.Cc413b.250465@composer.9fans.topicbox.com> <4d912a98-b0b1-476f-b306-491d91d2bf79@www.fastmail.com> <16074740400.63F6dbAdf.71435@composer.9fans.topicbox.com> In-Reply-To: <16074740400.63F6dbAdf.71435@composer.9fans.topicbox.com> Date: Wed, 9 Dec 2020 02:00:35 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="16074972351.4ABa43.73931" Content-Transfer-Encoding: 7bit Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 3cae6510-39ec-11eb-88bc-942f9134e1fa Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UODRiNDQ5MmY5MWYyYWJiNi1NMDkxYWJjYzU2ZGU0MjQ5MzdlYTli?= =?UTF-8?B?MTM2Pg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M091abcc56de424937ea9b136:1:Z71lXiz9IdNA6xu_2yAPlhHEr0rkFq6qYWbfBIOBkpE --16074972351.4ABa43.73931 Date: Wed, 9 Dec 2020 02:00:35 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable OK, here's what I've got:=C2=A0 diff --git a/bin/tap b/bin/tap index 5131834..fbfe066 100755 --- a/bin/tap +++ b/bin/tap @@ -8,26 +8,26 @@ cmd=3D$1 =C2=A0shift || fatal $usage =C2=A0user=3D`whoami` -# Create the tap device with tunctl -iface=3D`sudo tunctl -b -u $user` +# Create the tap device with tuntap +`sudo ip tuntap add tap5 mode tap user $user` =C2=A0# or openvpn =C2=A0#iface=3Dtap0 =C2=A0#sudo openvpn --mktun --dev $iface --user $user =C2=A0# Bring the tap device up -sudo /sbin/ifconfig $iface 0.0.0.0 up +sudo ip link set tap5 up =C2=A0# Add it to the bridge -sudo /usr/sbin/brctl addif br0 $iface +sudo ip link set tap5 master br0 =C2=A0# Launch 9vx (use -F to not fork) -$cmd "$@" -F "ether0=3Dtype=3Dtap dev=3D$iface" +$cmd "$@" -F "ether0=3Dtype=3Dtap dev=3Dtap5" =C2=A0# Bring the tap device down and disconnect from br0 -sudo /sbin/ifconfig $iface down -sudo /usr/sbin/brctl delif br0 $iface +sudo ip link set tap5 down +sudo ip link set tap5 nomaster -# Remove the tap device with tunctl -sudo tunctl -d $iface &> /dev/null +# Remove the tap device with tuntap +sudo ip tuntap del tap5 &> /dev/null =C2=A0# or openvpn =C2=A0#sudo openvpn --rmtun --dev $1 Running `tap 9vx -r 9front -u glenda`, then `ip/ipconfig` hangs for a while= , then it returns "DHCP failed". And on vanilla plan9 it just hangs. FWIW, = I got the same result using the old commands from net-tools.=C2=A0 And several details:=C2=A0 1. I had to hard-code the tap device name "tap5" because `ip tuntap ...` do= esn't return the interface name.=C2=A0 2. I have no idea what 0.0.0.0 is, or where to pass it in. (tried `ip link = set tap5 up address 0.0.0.0` but it complained the address was too short).= =C2=A0 Remy ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T84b4492f91f2abb6-M091ab= cc56de424937ea9b136 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription --16074972351.4ABa43.73931 Date: Wed, 9 Dec 2020 02:00:35 -0500 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
OK, here's what I've got: 
<= /div>

diff --git a/bin/tap b/bin/tap
index 5131834..fbfe0= 66 100755
--- a/b= in/tap
+++ b/bin/= tap
@@ -8,26 +8,2= 6 @@ cmd=3D$1
&nb= sp;shift || fatal $usage
 user=3D`whoami`
<= span class=3D"v121-font" style=3D"font-family: menlo, consolas, monospace, = sans-serif;">
-# Create the tap device= with tunctl
-ifa= ce=3D`sudo tunctl -b -u $user`
= +# Create the tap device with tuntap
+`sudo ip tuntap add tap5 mode tap user $= user`
 # or = openvpn
 #if= ace=3Dtap0
 = #sudo openvpn --mktun --dev $iface --user $user
<= /span>

 = # Bring the tap device up
-sudo /sbin/ifconfig $iface 0.0.0.0 up
<= /span>
+sudo ip link set tap5 up

 # Add it to the bridge
-sudo /usr/sbin/brctl addif br0 $iface=
+sudo ip link set tap5 master br0

<= div> # Launch 9vx (use -F to not fork)
-$cmd "$@" -F "ethe= r0=3Dtype=3Dtap dev=3D$iface"
<= div>+$cmd "$@" -F "ether0=3Dtype=3Dtap dev=3Dt= ap5"

<= /span>
 # Bring the tap device down and discon= nect from br0
-su= do /sbin/ifconfig $iface down
<= span class=3D"v121-font" style=3D"font-family: menlo, consolas, monospace, = sans-serif;">-sudo /usr/sbin/brctl delif br0 $iface
+sudo ip link set tap5 down
+sudo ip link set tap5 nomast= er

<= /div>
-# Remove the tap device with tunctl
-sudo tunctl -d $iface &>= ; /dev/null
+# Re= move the tap device with tuntap
+sudo ip tuntap del tap5 &> /dev/null
 # or openvpn
 #sudo openvpn --rmtun --= dev $1

Running `tap 9vx -r 9front -= u glenda`, then `ip/ipconfig` hangs for a while, then it returns "DHCP= failed". And on vanilla plan9 it just hangs. FWIW, I got the same res= ult using the old commands from net-tools. 

And several details: 
1. I had to hard-code the= tap device name "tap5" because `ip tuntap ...` doesn't retur= n the interface name. 
2. I have no idea what 0.0.0.0 = is, or where to pass it in. (tried `ip link set tap5 up address 0.0.0.0` bu= t it complained the address was too short). 

Remy
= --16074972351.4ABa43.73931--