9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
@ 2018-07-06 16:42 Alexander Kapshuk
  2018-07-06 19:25 ` Skip Tavakkolian
  0 siblings, 1 reply; 13+ messages in thread
From: Alexander Kapshuk @ 2018-07-06 16:42 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I've installed Plan 9 in qemu on Linux as instructed here:
https://9p.io/wiki/plan9/Installing_Plan_9_on_Qemu/index.html

Now I'm in the process of converting it into a standalone cpu server.
I'm following the instructions given here:
https://9p.io/wiki/plan9/Configuring_a_Standalone_CPU_Server/index.html

I would like to configure a static IP address for the cpu server, so I
can drawterm into it from other machines on my home network.
My knowledge of networking is limited. I understand that I need to put this:
ip/ipconfig -g <gateway-addr> ether /net/ether0 <ip-addr> <ip-mask>

into my /cfg/$sysname/cpurc.

What I don't understand, and am asking for assistance with, is where
those three ip addresses in the example above have to come from. Do I
add them to the ethernet interface on the host system, or is there a
way to do this from within the Plan 9 system?

Thanks.
Alexander Kapshuk.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
  2018-07-06 16:42 [9fans] Static ip configuration for a standalone cpu server in qemu on Linux Alexander Kapshuk
@ 2018-07-06 19:25 ` Skip Tavakkolian
  2018-07-07 14:33   ` Alexander Kapshuk
  0 siblings, 1 reply; 13+ messages in thread
From: Skip Tavakkolian @ 2018-07-06 19:25 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]

You could use private network addresses (10.0.0.0/8,  172.16.0.0/12 or
192.168.0.0/16). Your /lib/ndb/local file can then be setup around a subnet
like 192.168.9.0/24.  According to the following, qemu uses 10.0.2.0/24
when using "user mode networking" and provides a virtual dhcp (10.0.2.2),
dns (10.0.2.3) and cifs (10.0.2.4).  Using "tap" mode, you get to pick the
subnet in qemu-ifup script.

https://en.wikibooks.org/wiki/QEMU/Networking


On Fri, Jul 6, 2018 at 9:43 AM Alexander Kapshuk <
alexander.kapshuk@gmail.com> wrote:

> I've installed Plan 9 in qemu on Linux as instructed here:
> https://9p.io/wiki/plan9/Installing_Plan_9_on_Qemu/index.html
>
> Now I'm in the process of converting it into a standalone cpu server.
> I'm following the instructions given here:
> https://9p.io/wiki/plan9/Configuring_a_Standalone_CPU_Server/index.html
>
> I would like to configure a static IP address for the cpu server, so I
> can drawterm into it from other machines on my home network.
> My knowledge of networking is limited. I understand that I need to put
> this:
> ip/ipconfig -g <gateway-addr> ether /net/ether0 <ip-addr> <ip-mask>
>
> into my /cfg/$sysname/cpurc.
>
> What I don't understand, and am asking for assistance with, is where
> those three ip addresses in the example above have to come from. Do I
> add them to the ethernet interface on the host system, or is there a
> way to do this from within the Plan 9 system?
>
> Thanks.
> Alexander Kapshuk.
>
>

[-- Attachment #2: Type: text/html, Size: 2349 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
  2018-07-06 19:25 ` Skip Tavakkolian
@ 2018-07-07 14:33   ` Alexander Kapshuk
  2018-08-25 11:20     ` Alexander Kapshuk
  0 siblings, 1 reply; 13+ messages in thread
From: Alexander Kapshuk @ 2018-07-07 14:33 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Thanks. I'll give that a try.

On Fri, Jul 6, 2018 at 10:37 PM Skip Tavakkolian
<skip.tavakkolian@gmail.com> wrote:
>
> You could use private network addresses (10.0.0.0/8,  172.16.0.0/12 or 192.168.0.0/16). Your /lib/ndb/local file can then be setup around a subnet like 192.168.9.0/24.  According to the following, qemu uses 10.0.2.0/24 when using "user mode networking" and provides a virtual dhcp (10.0.2.2), dns (10.0.2.3) and cifs (10.0.2.4).  Using "tap" mode, you get to pick the subnet in qemu-ifup script.
>
> https://en.wikibooks.org/wiki/QEMU/Networking
>
>
> On Fri, Jul 6, 2018 at 9:43 AM Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
>>
>> I've installed Plan 9 in qemu on Linux as instructed here:
>> https://9p.io/wiki/plan9/Installing_Plan_9_on_Qemu/index.html
>>
>> Now I'm in the process of converting it into a standalone cpu server.
>> I'm following the instructions given here:
>> https://9p.io/wiki/plan9/Configuring_a_Standalone_CPU_Server/index.html
>>
>> I would like to configure a static IP address for the cpu server, so I
>> can drawterm into it from other machines on my home network.
>> My knowledge of networking is limited. I understand that I need to put this:
>> ip/ipconfig -g <gateway-addr> ether /net/ether0 <ip-addr> <ip-mask>
>>
>> into my /cfg/$sysname/cpurc.
>>
>> What I don't understand, and am asking for assistance with, is where
>> those three ip addresses in the example above have to come from. Do I
>> add them to the ethernet interface on the host system, or is there a
>> way to do this from within the Plan 9 system?
>>
>> Thanks.
>> Alexander Kapshuk.
>>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
  2018-07-07 14:33   ` Alexander Kapshuk
@ 2018-08-25 11:20     ` Alexander Kapshuk
  2018-08-25 17:53       ` hiro
  2018-08-25 18:27       ` Bakul Shah
  0 siblings, 2 replies; 13+ messages in thread
From: Alexander Kapshuk @ 2018-08-25 11:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I am trying to follow the instructions given here:

http://fqa.9front.org/fqa3.html#3.3.1.4.4
3.3.1.4.4 - Linux TAP

Here's what I've done so far:
(1). Set up a tap0 device as user root:
ip tuntap add dev tap0 mode tap user sasha
ip address add 10.0.0.1/24 dev tap0

ip addr show dev tap0
4: tap0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group
default qlen 1000
    link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 scope global tap0
       valid_lft forever preferred_lft forever

(2). Started qemu with Bell Labs system image as a regular user like so:
qemu-system-x86_64 \
-boot order=d \
-drive file=$HOME/Plan9.raw.img,format=raw \
-netdev tap,id=eth,ifname=tap0,script=no,downscript=no \
-device e1000,netdev=eth,mac=C6:1C:63:D9:91:1D

(3). Put these details into /lib/ndb/local:
sys=gnot ether=c61c63d9911d ip=10.0.0.2 ipmask=255.255.255.0 ipgw=10.0.0.1
dns=10.0.0.1
dom=gnot.plan9

(4). And these into /cfg/gnot/termrc
ip/ipconfig -g 10.0.0.1 ether /net/ether0 10.0.0.2 255.255.255.0

(5). And rebooted the system.

Current state of things:
(1). MAC address is recognised:
cat /net/ether0/addr
c61c63d9911d

(2). Still no networking.
ping'ing 10.0.0.2 from my Linux host results in all packets being dropped.
ip/ping 10.0.0.1 from qemu plan9 sees all packates dropped also.

I understand that it is something I am not doing right because of my
lack of networking knowledge.  In all likelyhood, the answer was given
by Skip in his reply to my original email.
The 9front wiki article probably too has all the information needed to
setup networking in qemu.
I am probably just not seeing it.

A further tip(s) would be much appreciated.
This list's patience for my ignorance is much appreciated.

On Sat, Jul 7, 2018 at 5:33 PM Alexander Kapshuk
<alexander.kapshuk@gmail.com> wrote:
>
> Thanks. I'll give that a try.
>
> On Fri, Jul 6, 2018 at 10:37 PM Skip Tavakkolian
> <skip.tavakkolian@gmail.com> wrote:
> >
> > You could use private network addresses (10.0.0.0/8,  172.16.0.0/12 or 192.168.0.0/16). Your /lib/ndb/local file can then be setup around a subnet like 192.168.9.0/24.  According to the following, qemu uses 10.0.2.0/24 when using "user mode networking" and provides a virtual dhcp (10.0.2.2), dns (10.0.2.3) and cifs (10.0.2.4).  Using "tap" mode, you get to pick the subnet in qemu-ifup script.
> >
> > https://en.wikibooks.org/wiki/QEMU/Networking
> >
> >
> > On Fri, Jul 6, 2018 at 9:43 AM Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
> >>
> >> I've installed Plan 9 in qemu on Linux as instructed here:
> >> https://9p.io/wiki/plan9/Installing_Plan_9_on_Qemu/index.html
> >>
> >> Now I'm in the process of converting it into a standalone cpu server.
> >> I'm following the instructions given here:
> >> https://9p.io/wiki/plan9/Configuring_a_Standalone_CPU_Server/index.html
> >>
> >> I would like to configure a static IP address for the cpu server, so I
> >> can drawterm into it from other machines on my home network.
> >> My knowledge of networking is limited. I understand that I need to put this:
> >> ip/ipconfig -g <gateway-addr> ether /net/ether0 <ip-addr> <ip-mask>
> >>
> >> into my /cfg/$sysname/cpurc.
> >>
> >> What I don't understand, and am asking for assistance with, is where
> >> those three ip addresses in the example above have to come from. Do I
> >> add them to the ethernet interface on the host system, or is there a
> >> way to do this from within the Plan 9 system?
> >>
> >> Thanks.
> >> Alexander Kapshuk.
> >>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
  2018-08-25 11:20     ` Alexander Kapshuk
@ 2018-08-25 17:53       ` hiro
  2018-08-25 18:27       ` Bakul Shah
  1 sibling, 0 replies; 13+ messages in thread
From: hiro @ 2018-08-25 17:53 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

what is the output of (1) after you did (7)
i am counting the 2nd 1 is a 6 (obviously).

On 8/25/18, Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
> I am trying to follow the instructions given here:
>
> http://fqa.9front.org/fqa3.html#3.3.1.4.4
> 3.3.1.4.4 - Linux TAP
>
> Here's what I've done so far:
> (1). Set up a tap0 device as user root:
> ip tuntap add dev tap0 mode tap user sasha
> ip address add 10.0.0.1/24 dev tap0
>
> ip addr show dev tap0
> 4: tap0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group
> default qlen 1000
>     link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
>     inet 10.0.0.1/24 scope global tap0
>        valid_lft forever preferred_lft forever
>
> (2). Started qemu with Bell Labs system image as a regular user like so:
> qemu-system-x86_64 \
> -boot order=d \
> -drive file=$HOME/Plan9.raw.img,format=raw \
> -netdev tap,id=eth,ifname=tap0,script=no,downscript=no \
> -device e1000,netdev=eth,mac=C6:1C:63:D9:91:1D
>
> (3). Put these details into /lib/ndb/local:
> sys=gnot ether=c61c63d9911d ip=10.0.0.2 ipmask=255.255.255.0 ipgw=10.0.0.1
> dns=10.0.0.1
> dom=gnot.plan9
>
> (4). And these into /cfg/gnot/termrc
> ip/ipconfig -g 10.0.0.1 ether /net/ether0 10.0.0.2 255.255.255.0
>
> (5). And rebooted the system.
>
> Current state of things:
> (1). MAC address is recognised:
> cat /net/ether0/addr
> c61c63d9911d
>
> (2). Still no networking.
> ping'ing 10.0.0.2 from my Linux host results in all packets being dropped.
> ip/ping 10.0.0.1 from qemu plan9 sees all packates dropped also.
>
> I understand that it is something I am not doing right because of my
> lack of networking knowledge.  In all likelyhood, the answer was given
> by Skip in his reply to my original email.
> The 9front wiki article probably too has all the information needed to
> setup networking in qemu.
> I am probably just not seeing it.
>
> A further tip(s) would be much appreciated.
> This list's patience for my ignorance is much appreciated.
>
> On Sat, Jul 7, 2018 at 5:33 PM Alexander Kapshuk
> <alexander.kapshuk@gmail.com> wrote:
>>
>> Thanks. I'll give that a try.
>>
>> On Fri, Jul 6, 2018 at 10:37 PM Skip Tavakkolian
>> <skip.tavakkolian@gmail.com> wrote:
>> >
>> > You could use private network addresses (10.0.0.0/8,  172.16.0.0/12 or
>> > 192.168.0.0/16). Your /lib/ndb/local file can then be setup around a
>> > subnet like 192.168.9.0/24.  According to the following, qemu uses
>> > 10.0.2.0/24 when using "user mode networking" and provides a virtual
>> > dhcp (10.0.2.2), dns (10.0.2.3) and cifs (10.0.2.4).  Using "tap" mode,
>> > you get to pick the subnet in qemu-ifup script.
>> >
>> > https://en.wikibooks.org/wiki/QEMU/Networking
>> >
>> >
>> > On Fri, Jul 6, 2018 at 9:43 AM Alexander Kapshuk
>> > <alexander.kapshuk@gmail.com> wrote:
>> >>
>> >> I've installed Plan 9 in qemu on Linux as instructed here:
>> >> https://9p.io/wiki/plan9/Installing_Plan_9_on_Qemu/index.html
>> >>
>> >> Now I'm in the process of converting it into a standalone cpu server.
>> >> I'm following the instructions given here:
>> >> https://9p.io/wiki/plan9/Configuring_a_Standalone_CPU_Server/index.html
>> >>
>> >> I would like to configure a static IP address for the cpu server, so I
>> >> can drawterm into it from other machines on my home network.
>> >> My knowledge of networking is limited. I understand that I need to put
>> >> this:
>> >> ip/ipconfig -g <gateway-addr> ether /net/ether0 <ip-addr> <ip-mask>
>> >>
>> >> into my /cfg/$sysname/cpurc.
>> >>
>> >> What I don't understand, and am asking for assistance with, is where
>> >> those three ip addresses in the example above have to come from. Do I
>> >> add them to the ethernet interface on the host system, or is there a
>> >> way to do this from within the Plan 9 system?
>> >>
>> >> Thanks.
>> >> Alexander Kapshuk.
>> >>
>
>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
  2018-08-25 11:20     ` Alexander Kapshuk
  2018-08-25 17:53       ` hiro
@ 2018-08-25 18:27       ` Bakul Shah
  2018-08-25 19:17         ` Alexander Kapshuk
  1 sibling, 1 reply; 13+ messages in thread
From: Bakul Shah @ 2018-08-25 18:27 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Sat, 25 Aug 2018 14:20:44 +0300 Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
> I am trying to follow the instructions given here:
>
> http://fqa.9front.org/fqa3.html#3.3.1.4.4
> 3.3.1.4.4 - Linux TAP
>
> Here's what I've done so far:
> (1). Set up a tap0 device as user root:
> ip tuntap add dev tap0 mode tap user sasha
> ip address add 10.0.0.1/24 dev tap0
>
> ip addr show dev tap0
> 4: tap0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group
> default qlen 1000
>     link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
>     inet 10.0.0.1/24 scope global tap0
>        valid_lft forever preferred_lft forever

I see that tap0 state is DOWN. Try bringing it up. 
If that still doesn't work, run 
    tcpdump -ni tap0
and tell us what you discover.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
  2018-08-25 18:27       ` Bakul Shah
@ 2018-08-25 19:17         ` Alexander Kapshuk
  2018-08-25 19:28           ` hiro
  2018-08-25 19:42           ` Bakul Shah
  0 siblings, 2 replies; 13+ messages in thread
From: Alexander Kapshuk @ 2018-08-25 19:17 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Thanks Hiro and Bakul for your prompt responses.

Here's what I've got to report...

I brought tap0 as user root:
ip link set dev tap0 up

ip addr show dev tap0
4: tap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP group default qlen 1000
    link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 scope global tap0
       valid_lft forever preferred_lft forever
    inet6 fe80::c41c:63ff:fed9:911d/64 scope link
       valid_lft forever preferred_lft forever

ping -c4 10.0.0.2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
>From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
>From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
>From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
>From 10.0.0.1 icmp_seq=4 Destination Host Unreachable

--- 10.0.0.2 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 75ms
pipe 4

# In qemu I got this output:
arpreq: 10.0.0.1 also has ether address c61c63d9911d

# Tcpdump output on Linux host:
tcpdump -nS -vv -i tap0
tcpdump: listening on tap0, link-type EN10MB (Ethernet), capture size
262144 bytes
22:12:40.302180 IP6 (hlim 255, next-header ICMPv6 (58) payload length:
16) fe80::c41c:63ff:fed9:911d > ff02::2: [icmp6 sum ok] ICMP6, router
solicitation, length 16
  source link-address option (1), length 8 (1): c6:1c:63:d9:91:1d
    0x0000:  c61c 63d9 911d
22:12:47.874535 IP (tos 0x0, ttl 1, id 18152, offset 0, flags [DF],
proto UDP (17), length 195)
    10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
22:12:48.875587 IP (tos 0x0, ttl 1, id 18675, offset 0, flags [DF],
proto UDP (17), length 195)
    10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
22:12:49.875963 IP (tos 0x0, ttl 1, id 19386, offset 0, flags [DF],
proto UDP (17), length 195)
    10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
22:12:50.876052 IP (tos 0x0, ttl 1, id 20194, offset 0, flags [DF],
proto UDP (17), length 195)
    10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
22:13:25.356189 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.0.0.2 tell 10.0.0.1, length 28
22:13:26.382153 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.0.0.2 tell 10.0.0.1, length 28
22:13:27.406149 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.0.0.2 tell 10.0.0.1, length 28
22:13:28.430247 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.0.0.2 tell 10.0.0.1, length 28
22:13:29.454154 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.0.0.2 tell 10.0.0.1, length 28
22:13:30.478150 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.0.0.2 tell 10.0.0.1, length 28

Thanks.
On Sat, Aug 25, 2018 at 9:29 PM Bakul Shah <bakul@bitblocks.com> wrote:
>
> On Sat, 25 Aug 2018 14:20:44 +0300 Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
> > I am trying to follow the instructions given here:
> >
> > http://fqa.9front.org/fqa3.html#3.3.1.4.4
> > 3.3.1.4.4 - Linux TAP
> >
> > Here's what I've done so far:
> > (1). Set up a tap0 device as user root:
> > ip tuntap add dev tap0 mode tap user sasha
> > ip address add 10.0.0.1/24 dev tap0
> >
> > ip addr show dev tap0
> > 4: tap0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group
> > default qlen 1000
> >     link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
> >     inet 10.0.0.1/24 scope global tap0
> >        valid_lft forever preferred_lft forever
>
> I see that tap0 state is DOWN. Try bringing it up.
> If that still doesn't work, run
>     tcpdump -ni tap0
> and tell us what you discover.
>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
  2018-08-25 19:17         ` Alexander Kapshuk
@ 2018-08-25 19:28           ` hiro
  2018-08-25 20:05             ` Alexander Kapshuk
  2018-08-25 19:42           ` Bakul Shah
  1 sibling, 1 reply; 13+ messages in thread
From: hiro @ 2018-08-25 19:28 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

the qemu error seems helpful: how did you chose mac=C6:1C:63:D9:91:1D
in the qemu command? i see no mention in the fqa that it should be the
same as the hypervisor's interface!

On 8/25/18, Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
> Thanks Hiro and Bakul for your prompt responses.
>
> Here's what I've got to report...
>
> I brought tap0 as user root:
> ip link set dev tap0 up
>
> ip addr show dev tap0
> 4: tap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
> state UP group default qlen 1000
>     link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
>     inet 10.0.0.1/24 scope global tap0
>        valid_lft forever preferred_lft forever
>     inet6 fe80::c41c:63ff:fed9:911d/64 scope link
>        valid_lft forever preferred_lft forever
>
> ping -c4 10.0.0.2
> PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
> From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
> From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
> From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
> From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
>
> --- 10.0.0.2 ping statistics ---
> 4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 75ms
> pipe 4
>
> # In qemu I got this output:
> arpreq: 10.0.0.1 also has ether address c61c63d9911d
>
> # Tcpdump output on Linux host:
> tcpdump -nS -vv -i tap0
> tcpdump: listening on tap0, link-type EN10MB (Ethernet), capture size
> 262144 bytes
> 22:12:40.302180 IP6 (hlim 255, next-header ICMPv6 (58) payload length:
> 16) fe80::c41c:63ff:fed9:911d > ff02::2: [icmp6 sum ok] ICMP6, router
> solicitation, length 16
>   source link-address option (1), length 8 (1): c6:1c:63:d9:91:1d
>     0x0000:  c61c 63d9 911d
> 22:12:47.874535 IP (tos 0x0, ttl 1, id 18152, offset 0, flags [DF],
> proto UDP (17), length 195)
>     10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
> 22:12:48.875587 IP (tos 0x0, ttl 1, id 18675, offset 0, flags [DF],
> proto UDP (17), length 195)
>     10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
> 22:12:49.875963 IP (tos 0x0, ttl 1, id 19386, offset 0, flags [DF],
> proto UDP (17), length 195)
>     10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
> 22:12:50.876052 IP (tos 0x0, ttl 1, id 20194, offset 0, flags [DF],
> proto UDP (17), length 195)
>     10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
> 22:13:25.356189 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> 10.0.0.2 tell 10.0.0.1, length 28
> 22:13:26.382153 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> 10.0.0.2 tell 10.0.0.1, length 28
> 22:13:27.406149 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> 10.0.0.2 tell 10.0.0.1, length 28
> 22:13:28.430247 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> 10.0.0.2 tell 10.0.0.1, length 28
> 22:13:29.454154 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> 10.0.0.2 tell 10.0.0.1, length 28
> 22:13:30.478150 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> 10.0.0.2 tell 10.0.0.1, length 28
>
> Thanks.
> On Sat, Aug 25, 2018 at 9:29 PM Bakul Shah <bakul@bitblocks.com> wrote:
>>
>> On Sat, 25 Aug 2018 14:20:44 +0300 Alexander Kapshuk
>> <alexander.kapshuk@gmail.com> wrote:
>> > I am trying to follow the instructions given here:
>> >
>> > http://fqa.9front.org/fqa3.html#3.3.1.4.4
>> > 3.3.1.4.4 - Linux TAP
>> >
>> > Here's what I've done so far:
>> > (1). Set up a tap0 device as user root:
>> > ip tuntap add dev tap0 mode tap user sasha
>> > ip address add 10.0.0.1/24 dev tap0
>> >
>> > ip addr show dev tap0
>> > 4: tap0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group
>> > default qlen 1000
>> >     link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
>> >     inet 10.0.0.1/24 scope global tap0
>> >        valid_lft forever preferred_lft forever
>>
>> I see that tap0 state is DOWN. Try bringing it up.
>> If that still doesn't work, run
>>     tcpdump -ni tap0
>> and tell us what you discover.
>>
>
>



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
  2018-08-25 19:17         ` Alexander Kapshuk
  2018-08-25 19:28           ` hiro
@ 2018-08-25 19:42           ` Bakul Shah
  1 sibling, 0 replies; 13+ messages in thread
From: Bakul Shah @ 2018-08-25 19:42 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Sat, 25 Aug 2018 22:17:16 +0300 Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
> 22:13:25.356189 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> 10.0.0.2 tell 10.0.0.1, length 28

As Hiro mentioned it is strange that both sides have the same
mac addr as that will confuse them both.  Pick a different one
for the VM.

If that doesn't work, as an experiment try adding a static arp.
sudo arp -s 10.0.0.2  <VM's mac addr>

tcpdump right from the start would be useful.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
  2018-08-25 19:28           ` hiro
@ 2018-08-25 20:05             ` Alexander Kapshuk
  2018-08-25 20:59               ` hiro
  0 siblings, 1 reply; 13+ messages in thread
From: Alexander Kapshuk @ 2018-08-25 20:05 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 4516 bytes --]

I thought that the mac address in the qemu command had to be the same as
the link/ether address of the tap device.
Should I make one up and use that in the qemu command?
Thanks.


On Sat, Aug 25, 2018, 22:49 hiro <23hiro@gmail.com> wrote:

> the qemu error seems helpful: how did you chose mac=C6:1C:63:D9:91:1D
> in the qemu command? i see no mention in the fqa that it should be the
> same as the hypervisor's interface!
>
> On 8/25/18, Alexander Kapshuk <alexander.kapshuk@gmail.com> wrote:
> > Thanks Hiro and Bakul for your prompt responses.
> >
> > Here's what I've got to report...
> >
> > I brought tap0 as user root:
> > ip link set dev tap0 up
> >
> > ip addr show dev tap0
> > 4: tap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
> > state UP group default qlen 1000
> >     link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
> >     inet 10.0.0.1/24 scope global tap0
> >        valid_lft forever preferred_lft forever
> >     inet6 fe80::c41c:63ff:fed9:911d/64 scope link
> >        valid_lft forever preferred_lft forever
> >
> > ping -c4 10.0.0.2
> > PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
> > From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
> > From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
> > From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
> > From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
> >
> > --- 10.0.0.2 ping statistics ---
> > 4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 75ms
> > pipe 4
> >
> > # In qemu I got this output:
> > arpreq: 10.0.0.1 also has ether address c61c63d9911d
> >
> > # Tcpdump output on Linux host:
> > tcpdump -nS -vv -i tap0
> > tcpdump: listening on tap0, link-type EN10MB (Ethernet), capture size
> > 262144 bytes
> > 22:12:40.302180 IP6 (hlim 255, next-header ICMPv6 (58) payload length:
> > 16) fe80::c41c:63ff:fed9:911d > ff02::2: [icmp6 sum ok] ICMP6, router
> > solicitation, length 16
> >   source link-address option (1), length 8 (1): c6:1c:63:d9:91:1d
> >     0x0000:  c61c 63d9 911d
> > 22:12:47.874535 IP (tos 0x0, ttl 1, id 18152, offset 0, flags [DF],
> > proto UDP (17), length 195)
> >     10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
> > 22:12:48.875587 IP (tos 0x0, ttl 1, id 18675, offset 0, flags [DF],
> > proto UDP (17), length 195)
> >     10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
> > 22:12:49.875963 IP (tos 0x0, ttl 1, id 19386, offset 0, flags [DF],
> > proto UDP (17), length 195)
> >     10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
> > 22:12:50.876052 IP (tos 0x0, ttl 1, id 20194, offset 0, flags [DF],
> > proto UDP (17), length 195)
> >     10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
> > 22:13:25.356189 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> > 10.0.0.2 tell 10.0.0.1, length 28
> > 22:13:26.382153 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> > 10.0.0.2 tell 10.0.0.1, length 28
> > 22:13:27.406149 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> > 10.0.0.2 tell 10.0.0.1, length 28
> > 22:13:28.430247 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> > 10.0.0.2 tell 10.0.0.1, length 28
> > 22:13:29.454154 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> > 10.0.0.2 tell 10.0.0.1, length 28
> > 22:13:30.478150 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> > 10.0.0.2 tell 10.0.0.1, length 28
> >
> > Thanks.
> > On Sat, Aug 25, 2018 at 9:29 PM Bakul Shah <bakul@bitblocks.com> wrote:
> >>
> >> On Sat, 25 Aug 2018 14:20:44 +0300 Alexander Kapshuk
> >> <alexander.kapshuk@gmail.com> wrote:
> >> > I am trying to follow the instructions given here:
> >> >
> >> > http://fqa.9front.org/fqa3.html#3.3.1.4.4
> >> > 3.3.1.4.4 - Linux TAP
> >> >
> >> > Here's what I've done so far:
> >> > (1). Set up a tap0 device as user root:
> >> > ip tuntap add dev tap0 mode tap user sasha
> >> > ip address add 10.0.0.1/24 dev tap0
> >> >
> >> > ip addr show dev tap0
> >> > 4: tap0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group
> >> > default qlen 1000
> >> >     link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
> >> >     inet 10.0.0.1/24 scope global tap0
> >> >        valid_lft forever preferred_lft forever
> >>
> >> I see that tap0 state is DOWN. Try bringing it up.
> >> If that still doesn't work, run
> >>     tcpdump -ni tap0
> >> and tell us what you discover.
> >>
> >
> >
>
>

[-- Attachment #2: Type: text/html, Size: 6121 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
  2018-08-25 20:05             ` Alexander Kapshuk
@ 2018-08-25 20:59               ` hiro
  2018-08-26  4:56                 ` Alexander Kapshuk
  0 siblings, 1 reply; 13+ messages in thread
From: hiro @ 2018-08-25 20:59 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

nothing in the fqa mentions the tap device's mac address (which linux
generated randomly in order not to conflict with whatever you might be
using on the other side).

look at the tap device as an ethernet interface that is plugged into
the same L2 switch as the VM's virtual interface.

you don't want mac address collisions in one L2 network, so yes, use a
different one for the VM.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
  2018-08-25 20:59               ` hiro
@ 2018-08-26  4:56                 ` Alexander Kapshuk
  2018-08-26 13:45                   ` Alexander Kapshuk
  0 siblings, 1 reply; 13+ messages in thread
From: Alexander Kapshuk @ 2018-08-26  4:56 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 551 bytes --]

Understood.
I'll give it a try and let you know how I go.
Thanks.


On Sun, Aug 26, 2018, 00:20 hiro <23hiro@gmail.com> wrote:

> nothing in the fqa mentions the tap device's mac address (which linux
> generated randomly in order not to conflict with whatever you might be
> using on the other side).
>
> look at the tap device as an ethernet interface that is plugged into
> the same L2 switch as the VM's virtual interface.
>
> you don't want mac address collisions in one L2 network, so yes, use a
> different one for the VM.
>
>

[-- Attachment #2: Type: text/html, Size: 886 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux
  2018-08-26  4:56                 ` Alexander Kapshuk
@ 2018-08-26 13:45                   ` Alexander Kapshuk
  0 siblings, 0 replies; 13+ messages in thread
From: Alexander Kapshuk @ 2018-08-26 13:45 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

With the tap device up:
ip addr show dev tap0
4: tap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UP group default qlen 1000
    link/ether 9a:44:ad:1f:39:d9 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/24 scope global tap0
       valid_lft forever preferred_lft forever
    inet6 fe80::9844:adff:fe1f:39d9/64 scope link
       valid_lft forever preferred_lft forever

And the qemu command using the mac address given in the fqa example:
qemu-system-x86_64 \
-boot order=d \
-drive file=$HOME/Plan9.raw.img,format=raw \
-netdev tap,id=eth,ifname=tap0,script=no,downscript=no \
-device e1000,netdev=eth,mac=52:54:00:00:EE:03

And the ether= attribute removed from /lib/ndb/local,

Both pings below work now.
ping 10.0.0.2 # Linux
ip/ping 10.0.0.1 # Plan 9

tcpdump -nS -vv -i tap0
tcpdump: listening on tap0, link-type EN10MB (Ethernet), capture size
262144 bytes
16:35:00.265147 IP (tos 0x0, ttl 1, id 46876, offset 0, flags [DF],
proto UDP (17), length 195)
    10.0.0.1.48952 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
16:35:01.266364 IP (tos 0x0, ttl 1, id 47164, offset 0, flags [DF],
proto UDP (17), length 195)
    10.0.0.1.48952 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
16:35:02.266828 IP (tos 0x0, ttl 1, id 47770, offset 0, flags [DF],
proto UDP (17), length 195)
    10.0.0.1.48952 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
16:35:03.267406 IP (tos 0x0, ttl 1, id 48737, offset 0, flags [DF],
proto UDP (17), length 195)
    10.0.0.1.48952 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
16:35:28.213321 IP (tos 0x0, ttl 255, id 5, offset 0, flags [none],
proto ICMP (1), length 64)
    10.0.0.2 > 10.0.0.1: ICMP echo request, id 46534, seq 24833, length 44
16:35:28.213374 IP (tos 0x0, ttl 64, id 2728, offset 0, flags [none],
proto ICMP (1), length 64)
    10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46534, seq 24833, length 44
16:35:29.212816 IP (tos 0x0, ttl 255, id 6, offset 0, flags [none],
proto ICMP (1), length 64)
    10.0.0.2 > 10.0.0.1: ICMP echo request, id 46534, seq 24834, length 44
16:35:29.212873 IP (tos 0x0, ttl 64, id 2867, offset 0, flags [none],
proto ICMP (1), length 64)
    10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46534, seq 24834, length 44
16:35:30.223989 IP (tos 0x0, ttl 255, id 7, offset 0, flags [none],
proto ICMP (1), length 64)
    10.0.0.2 > 10.0.0.1: ICMP echo request, id 46534, seq 24835, length 44
16:35:30.224042 IP (tos 0x0, ttl 64, id 2906, offset 0, flags [none],
proto ICMP (1), length 64)
    10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46534, seq 24835, length 44
16:35:31.223030 IP (tos 0x0, ttl 255, id 8, offset 0, flags [none],
proto ICMP (1), length 64)
    10.0.0.2 > 10.0.0.1: ICMP echo request, id 46534, seq 24836, length 44
16:35:31.223086 IP (tos 0x0, ttl 64, id 3895, offset 0, flags [none],
proto ICMP (1), length 64)
    10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46534, seq 24836, length 44
16:35:32.222034 IP (tos 0x0, ttl 255, id 9, offset 0, flags [none],
proto ICMP (1), length 64)
    10.0.0.2 > 10.0.0.1: ICMP echo request, id 46534, seq 24837, length 44
16:35:32.222090 IP (tos 0x0, ttl 64, id 4241, offset 0, flags [none],
proto ICMP (1), length 64)
    10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46534, seq 24837, length 44
16:35:33.233714 IP (tos 0x0, ttl 255, id 10, offset 0, flags [none],
proto ICMP (1), length 64)
    10.0.0.2 > 10.0.0.1: ICMP echo request, id 46534, seq 24838, length 44
16:35:33.233769 IP (tos 0x0, ttl 64, id 4545, offset 0, flags [none],
proto ICMP (1), length 64)
    10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46534, seq 24838, length 44


On to the standalone CPU + auth server setup instructions now.
Thanks very much for all your help.
On Sun, Aug 26, 2018 at 7:56 AM Alexander Kapshuk
<alexander.kapshuk@gmail.com> wrote:
>
> Understood.
> I'll give it a try and let you know how I go.
> Thanks.
>
>
> On Sun, Aug 26, 2018, 00:20 hiro <23hiro@gmail.com> wrote:
>>
>> nothing in the fqa mentions the tap device's mac address (which linux
>> generated randomly in order not to conflict with whatever you might be
>> using on the other side).
>>
>> look at the tap device as an ethernet interface that is plugged into
>> the same L2 switch as the VM's virtual interface.
>>
>> you don't want mac address collisions in one L2 network, so yes, use a
>> different one for the VM.
>>



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-08-26 13:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-06 16:42 [9fans] Static ip configuration for a standalone cpu server in qemu on Linux Alexander Kapshuk
2018-07-06 19:25 ` Skip Tavakkolian
2018-07-07 14:33   ` Alexander Kapshuk
2018-08-25 11:20     ` Alexander Kapshuk
2018-08-25 17:53       ` hiro
2018-08-25 18:27       ` Bakul Shah
2018-08-25 19:17         ` Alexander Kapshuk
2018-08-25 19:28           ` hiro
2018-08-25 20:05             ` Alexander Kapshuk
2018-08-25 20:59               ` hiro
2018-08-26  4:56                 ` Alexander Kapshuk
2018-08-26 13:45                   ` Alexander Kapshuk
2018-08-25 19:42           ` Bakul Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).