public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] TAP device not created on running "ping_test"
@ 2009-07-24  9:39 Mandeep Sandhu
  2009-07-24 10:53 ` Sergei Gavrikov
  0 siblings, 1 reply; 22+ messages in thread
From: Mandeep Sandhu @ 2009-07-24  9:39 UTC (permalink / raw)
  To: ecos-discuss

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

Hi all,

So after my ordeal with the Hello world app...I've jumped onto to a
more audacious task! :)
...to get some basic networking working with the virt TAP device.

This is what I did:

$ mkdir net
$ cd net
$ ecosconfig new linux
$ ecosconfig add fileio net freebsd_net eth_drivers
$ ecosconfig tree

(alter the usual suspects i.e command prefix, GCC switch fno-statck-... etc)
$ make

(fix libgcc_eh.a thingy)
$ make tests

I've configured static IP for eth0 on ecos
Self IP=10.0.0.2
netmask=255.255.255.0
gw=10.0.0.1
server=10.0.0.10

I used the tdf file given here:
http://dsl.ee.unsw.edu.au/dsl-cdrom/unsw/projects/ecos/ecos/packages/devs/eth/synth/ecosynth/current/host/ethernet.tdf

This file creates a TAP device tap3 with MAC=00:FE:42:63:84:A5

I've also built the rawether app (this has the suid bit set):
$ ls -l /usr/local/libexec/ecos/devs/eth/synth/ecosynth/v3_0/rawether
-rwsr-xr-x 1 root root 19339 2009-07-23 16:04
/usr/local/libexec/ecos/devs/eth/synth/ecosynth/v3_0/rawether

My system also has the tun device:
$ ls -l /dev/net/tun
crw-rw-rw- 1 root root 10, 200 2009-07-17 09:57 /dev/net/tun

Now when I run the ping_test app, I see both the "ecossynth" and
"rawether" process's running, but no
tap device is created! Shouldn't the rawether proc open the tun device
which will result in the tap3
device being created?

The ping test does not succeed though but thats because there's no
other interface on the 10 network.

Test run o/p attached.

Thanks,
-mandeep

[-- Attachment #2: ping_test_out.txt --]
[-- Type: text/plain, Size: 1879 bytes --]

[cyg_net_init] Init: mbinit(0x00000000) 
[cyg_net_init] Init: cyg_net_init_devs(0x00000000) 
Init device 'synth_eth0' 
[cyg_net_init] Init: loopattach(0x00000000) 
[cyg_net_init] Init: ifinit(0x00000000) 
[cyg_net_init] Init: domaininit(0x00000000) 
[cyg_net_init] Init: cyg_net_add_domain(0x02001700) 
New domain internet at 0x00000000 
[cyg_net_init] Init: cyg_net_add_domain(0x02001140) 
New domain route at 0x00000000 
[cyg_net_init] Init: call_route_init(0x00000000) 
[cyg_net_init] Done 
Start PING test 
BOOTP[eth0] op: REPLY 
       htype: Ethernet 
        hlen: 6 
        hops: 0 
         xid: 0x0 
        secs: 0 
       flags: 0x0 
       hw_addr: 00:fe:42:63:84:a5 
     client IP: 10.0.0.2 
         my IP: 10.0.0.2 
     server IP: 10.0.0.10 
    gateway IP: 10.0.0.1 
  options: 
        subnet mask: 255.255.255.0 
       IP broadcast: 10.0.0.255 
            gateway: 10.0.0.1 
PING server 10.0.0.10 
recvfrom: Operation timed out 
recvfrom: Operation timed out 
recvfrom: Operation timed out 
recvfrom: Operation timed out 
recvfrom: Operation timed out 
recvfrom: Operation timed out 
recvfrom: Operation timed out 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
Sent 16 packets, received 0 OK, 0 bad 
PING server 10.0.0.42 
recvfrom: Operation timed out 
recvfrom: Operation timed out 
recvfrom: Operation timed out 
recvfrom: Operation timed out 
recvfrom: Operation timed out 
recvfrom: Operation timed out 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
sendto: Host is down 
Sent 16 packets, received 0 OK, 0 bad 
PASS:<Ping test OK> 
EXIT:<done> 


[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-24  9:39 [ECOS] TAP device not created on running "ping_test" Mandeep Sandhu
@ 2009-07-24 10:53 ` Sergei Gavrikov
  2009-07-27  4:54   ` Mandeep Sandhu
  2009-07-27 13:44   ` Mandeep Sandhu
  0 siblings, 2 replies; 22+ messages in thread
From: Sergei Gavrikov @ 2009-07-24 10:53 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

Mandeep Sandhu wrote:
> My system also has the tun device:
> $ ls -l /dev/net/tun
> crw-rw-rw- 1 root root 10, 200 2009-07-17 09:57 /dev/net/tun
> 
> Now when I run the ping_test app, I see both the "ecossynth" and
> "rawether" process's running, but no tap device is created! Shouldn't
> the rawether proc open the tun device which will result in the tap3
> device being created?

Hi Mandeep

I would narrow a circle. First, try to bring up and configure any tapN
device on a host handy (without rawether and eCos app). Test then that
interface. I found that `tunctl' utility is very useful for that. I'd
installed it from sources, but, the utility exists in the Ubuntu's
`uml-utilities' package.

I want to believe that is host-side issue. It's just command to start

man tunctl

Create (tunctl), configure (ifconfig/route) e.g. tap0 device and check
that works as you could expect (ping). Then go to eCos network tests.

Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-24 10:53 ` Sergei Gavrikov
@ 2009-07-27  4:54   ` Mandeep Sandhu
  2009-07-27 13:44   ` Mandeep Sandhu
  1 sibling, 0 replies; 22+ messages in thread
From: Mandeep Sandhu @ 2009-07-27  4:54 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

On Fri, Jul 24, 2009 at 4:23 PM, Sergei
Gavrikov<sergei.gavrikov@gmail.com> wrote:
> Mandeep Sandhu wrote:
>> My system also has the tun device:
>> $ ls -l /dev/net/tun
>> crw-rw-rw- 1 root root 10, 200 2009-07-17 09:57 /dev/net/tun
>>
>> Now when I run the ping_test app, I see both the "ecossynth" and
>> "rawether" process's running, but no tap device is created! Shouldn't
>> the rawether proc open the tun device which will result in the tap3
>> device being created?
>
> Hi Mandeep
>
> I would narrow a circle. First, try to bring up and configure any tapN
> device on a host handy (without rawether and eCos app). Test then that
> interface. I found that `tunctl' utility is very useful for that. I'd
> installed it from sources, but, the utility exists in the Ubuntu's
> `uml-utilities' package.
>
> I want to believe that is host-side issue. It's just command to start
>
> man tunctl
>
> Create (tunctl), configure (ifconfig/route) e.g. tap0 device and check
> that works as you could expect (ping). Then go to eCos network tests.

Ok. Will do.

-mandeep

>
> Sergei
>

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-24 10:53 ` Sergei Gavrikov
  2009-07-27  4:54   ` Mandeep Sandhu
@ 2009-07-27 13:44   ` Mandeep Sandhu
  2009-07-27 23:26     ` Sergei Gavrikov
  1 sibling, 1 reply; 22+ messages in thread
From: Mandeep Sandhu @ 2009-07-27 13:44 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

> Hi Mandeep
>
> I would narrow a circle. First, try to bring up and configure any tapN
> device on a host handy (without rawether and eCos app). Test then that
> interface. I found that `tunctl' utility is very useful for that. I'd
> installed it from sources, but, the utility exists in the Ubuntu's
> `uml-utilities' package.
>
> I want to believe that is host-side issue. It's just command to start
>
> man tunctl
>
> Create (tunctl), configure (ifconfig/route) e.g. tap0 device and check
> that works as you could expect (ping). Then go to eCos network tests.

Thanks for pointing out tunctl. But I'm not able to get ping to work...!

I created a device tap0. Assigned it an IP addr: 1.1.1.2/24
Then I setup eth0 with IP 1.1.1.3/24

$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:1d:09:54:e6:e3
          inet addr:1.1.1.2  Bcast:1.1.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17

$ ifconfig tap0
tap0      Link encap:Ethernet  HWaddr 4e:54:8e:5a:9e:80
          inet addr:1.1.1.3  Bcast:1.1.1.255  Mask:255.255.255.0
          inet6 addr: fe80::4c54:8eff:fe5a:9e80/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:52 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:17 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:2184 (2.1 KB)  TX bytes:0 (0.0 B)

pinging each of these IP's obviously works as the kernel sees these 2
IP addr's as assigned local interfaces, so I guess the packets never go out
of the interface.

$ ping 1.1.1.2
PING 1.1.1.2 (1.1.1.2) 56(84) bytes of data.
64 bytes from 1.1.1.2: icmp_seq=1 ttl=64 time=0.044 ms
^C
--- 1.1.1.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.044/0.044/0.044/0.000 ms
$ ping 1.1.1.3
PING 1.1.1.3 (1.1.1.3) 56(84) bytes of data.
64 bytes from 1.1.1.3: icmp_seq=1 ttl=64 time=0.041 ms
64 bytes from 1.1.1.3: icmp_seq=2 ttl=64 time=0.041 ms
^C
--- 1.1.1.3 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.041/0.041/0.041/0.000 ms
$

But, if I ping specifying the interface, then it does not work!

$ ping -I tap0 1.1.1.2
PING 1.1.1.2 (1.1.1.2) from 1.1.1.2 tap0: 56(84) bytes of data.
From 1.1.1.3 icmp_seq=1 Destination Host Unreachable
From 1.1.1.3 icmp_seq=2 Destination Host Unreachable
From 1.1.1.3 icmp_seq=3 Destination Host Unreachable
^C
--- 1.1.1.2 ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3015ms
, pipe 3
$

Shouldn't the packet coming out of tap0 be routed to the proper interface by
the kernel?

I also ran the "ping_test" of ecos with the following setup.

My host:
ethernet.tdf : eth0 real eth0
ecos IP: 1.1.1.3/24
server IP: 1.1.1.10

I had connected my PC's eth0 to another PCs eth port. On second PC
eth0's IP was 1.1.1.10

Running the ping test shows that ecos is able to send/rcv packets from 1.1.1.10

Now if I change tdf file to use tap0:
eth0 ethertap tap0 00:FE:42:63:84:A5

And setup eth0 locally on my PC with same IP (1.1.1.10), the test
starts failing.

Any pointers?

I'm trying to create a TAP device from a userspace program to see if I
get a tap0
device when I open /dev/net/tun with the proper IOCTL. The sample snip
shown here does not work though!
http://www.mjmwired.net/kernel/Documentation/networking/tuntap.txt

The program is not even compiling! :( Trying to fix that now!

-mandeep

>
> Sergei
>

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-27 13:44   ` Mandeep Sandhu
@ 2009-07-27 23:26     ` Sergei Gavrikov
  2009-07-28  7:16       ` Mandeep Sandhu
  2009-07-28  7:49       ` Mandeep Sandhu
  0 siblings, 2 replies; 22+ messages in thread
From: Sergei Gavrikov @ 2009-07-27 23:26 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

On Mon, Jul 27, 2009 at 07:14:10PM +0530, Mandeep Sandhu wrote:
> Thanks for pointing out tunctl. But I'm not able to get ping to work...!

[snip]

I did tell you about `tunctl' utility to give you manual control for
tun/tap interfaces. And as I could understand `tunctl' gave you ability
to create tap interface and check it. That was Step #1. There were and
other keywords there, e.g. dhcpd.

Some automation. You can put in /etc/network/interfaces something likes
the below

iface tap0 inet manual
  up tunctl -t tap0
  up ip l set up dev tap0
  up ip a add 10.1.1.1/24 brd + dev tap0
  down ip l set down dev tap0
  down tunctl -d tap0

That lets you manually to bring up/down tap0 iface for synth net tests if
you want: sudo ifup tap0; sudo ifdown tap0.

And then I would suggest you to setup ecosynth networking using _dhcp_
protocol against those reserved static IP pools. You have to configure
dhcp-server to listen on tap0 iface; start the server and test that
server offers IPs from a set range using `dhclient' "tester".

On Ubuntu, (I want to belive) it possible to configure the server using

  $ sudo dpkg-reconfigure dhcp3-server

I'm sorry, but, I run/configure dhcpd manually. At the least, be sure that
/etc/default/dhcp3-server points on tap0 interface

INTERFACES="tap0"

So, before to run `ping_test' you have to get the "offered IPs" from
dhcp-server on tap0 using dhclient.

Sergei

P.S.

May be the below will be useful (cut from my old notes for myself :-) It
is the very minimalist sandbox (for tests purposes only). But, it worked
for me.

1) Bring up tap0 (refer to snip the above)

  $ sudo ifup tap0

2) Run DHCP server as

  $ sudo env INTERFACES="tap0" dhcpd3 -d -f -cf mydhcpd.conf tap0

# mydhcpd.conf --
default-lease-time 30;
max-lease-time 30;
subnet 10.1.1.0 netmask 255.255.255.0 {
	range 10.1.1.20 10.1.1.30;
}

3) Check that server offers IP (run dhclient in another window), when
you'll see that the server offered IP, hit ^C

  $ sudo dhclient3 -d tap0

If you have success with point 3 (only then!), rebuild synth net tests
with the defaults network settings (No static IP addresses!) with alone
tweak

cdl_option CYGPKG_NET_BUILD_HW_TESTS {
    user_value 1
};

and run ping test as

  $ ping_test -nw -io -t my.tdf

(be sure that that dhcp server is running still)

# my.tdf --
synth_device ethernet {
    eth0 ethertap tap0
}
# EOF


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-27 23:26     ` Sergei Gavrikov
@ 2009-07-28  7:16       ` Mandeep Sandhu
  2009-07-28  7:49       ` Mandeep Sandhu
  1 sibling, 0 replies; 22+ messages in thread
From: Mandeep Sandhu @ 2009-07-28  7:16 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 4:56 AM, Sergei
Gavrikov<sergei.gavrikov@gmail.com> wrote:
> On Mon, Jul 27, 2009 at 07:14:10PM +0530, Mandeep Sandhu wrote:
>> Thanks for pointing out tunctl. But I'm not able to get ping to work...!
>
> [snip]
>
> I did tell you about `tunctl' utility to give you manual control for
> tun/tap interfaces. And as I could understand `tunctl' gave you ability
> to create tap interface and check it. That was Step #1. There were and
> other keywords there, e.g. dhcpd.

Yes, I saw the other keywords but thought  that running tests with static
IP addr's would be easier! :)

Let me try with DHPC and get back.

Thanks,
-mandeep

>
>
> And then I would suggest you to setup ecosynth networking using _dhcp_
> protocol against those reserved static IP pools. You have to configure
> dhcp-server to listen on tap0 iface; start the server and test that
> server offers IPs from a set range using `dhclient' "tester".
>
> On Ubuntu, (I want to belive) it possible to configure the server using
>
>  $ sudo dpkg-reconfigure dhcp3-server
>
> I'm sorry, but, I run/configure dhcpd manually. At the least, be sure that
> /etc/default/dhcp3-server points on tap0 interface
>
> INTERFACES="tap0"
>
> So, before to run `ping_test' you have to get the "offered IPs" from
> dhcp-server on tap0 using dhclient.
>
> Sergei
>
> P.S.
>
> May be the below will be useful (cut from my old notes for myself :-) It
> is the very minimalist sandbox (for tests purposes only). But, it worked
> for me.
>
> 1) Bring up tap0 (refer to snip the above)
>
>  $ sudo ifup tap0
>
> 2) Run DHCP server as
>
>  $ sudo env INTERFACES="tap0" dhcpd3 -d -f -cf mydhcpd.conf tap0
>
> # mydhcpd.conf --
> default-lease-time 30;
> max-lease-time 30;
> subnet 10.1.1.0 netmask 255.255.255.0 {
>        range 10.1.1.20 10.1.1.30;
> }
>
> 3) Check that server offers IP (run dhclient in another window), when
> you'll see that the server offered IP, hit ^C
>
>  $ sudo dhclient3 -d tap0
>
> If you have success with point 3 (only then!), rebuild synth net tests
> with the defaults network settings (No static IP addresses!) with alone
> tweak
>
> cdl_option CYGPKG_NET_BUILD_HW_TESTS {
>    user_value 1
> };
>
> and run ping test as
>
>  $ ping_test -nw -io -t my.tdf
>
> (be sure that that dhcp server is running still)
>
> # my.tdf --
> synth_device ethernet {
>    eth0 ethertap tap0
> }
> # EOF
>
>

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-27 23:26     ` Sergei Gavrikov
  2009-07-28  7:16       ` Mandeep Sandhu
@ 2009-07-28  7:49       ` Mandeep Sandhu
  2009-07-28  8:07         ` Sergei Gavrikov
  1 sibling, 1 reply; 22+ messages in thread
From: Mandeep Sandhu @ 2009-07-28  7:49 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

> May be the below will be useful (cut from my old notes for myself :-) It
> is the very minimalist sandbox (for tests purposes only). But, it worked
> for me.
>
> 1) Bring up tap0 (refer to snip the above)
>
>  $ sudo ifup tap0
>
> 2) Run DHCP server as
>
>  $ sudo env INTERFACES="tap0" dhcpd3 -d -f -cf mydhcpd.conf tap0
>
> # mydhcpd.conf --
> default-lease-time 30;
> max-lease-time 30;
> subnet 10.1.1.0 netmask 255.255.255.0 {
>        range 10.1.1.20 10.1.1.30;
> }
>

Very strange, I get this error!

# dhcpd3 -d -f -cf /tmp/mydhcpd.conf tap0
Internet Systems Consortium DHCP Server V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Can't open /tmp/mydhcpd.conf: Permission denied

# ls -l /tmp/mydhcpd.conf
-rwxrwxrwx 1 mandeep mandeep 119 2009-07-28 13:09 /tmp/mydhcpd.conf

I've tried with 666 perms for /tmp/mydhcpd.conf too, but I get the same error.

Will try udhcpd now.

> 3) Check that server offers IP (run dhclient in another window), when
> you'll see that the server offered IP, hit ^C
>
>  $ sudo dhclient3 -d tap0
>
> If you have success with point 3 (only then!), rebuild synth net tests
> with the defaults network settings (No static IP addresses!) with alone
> tweak
>
> cdl_option CYGPKG_NET_BUILD_HW_TESTS {
>    user_value 1
> };
>
> and run ping test as
>
>  $ ping_test -nw -io -t my.tdf
>
> (be sure that that dhcp server is running still)
>
> # my.tdf --
> synth_device ethernet {
>    eth0 ethertap tap0
> }
> # EOF
>
>

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28  7:49       ` Mandeep Sandhu
@ 2009-07-28  8:07         ` Sergei Gavrikov
  2009-07-28  9:02           ` Mandeep Sandhu
  0 siblings, 1 reply; 22+ messages in thread
From: Sergei Gavrikov @ 2009-07-28  8:07 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 01:19:23PM +0530, Mandeep Sandhu wrote:
> Very strange, I get this error!
> 
> # dhcpd3 -d -f -cf /tmp/mydhcpd.conf tap0
> Internet Systems Consortium DHCP Server V3.1.1
> Copyright 2004-2008 Internet Systems Consortium.
> All rights reserved.
> For info, please visit http://www.isc.org/sw/dhcp/
> Can't open /tmp/mydhcpd.conf: Permission denied
> 
> # ls -l /tmp/mydhcpd.conf
> -rwxrwxrwx 1 mandeep mandeep 119 2009-07-28 13:09 /tmp/mydhcpd.conf
> 
> I've tried with 666 perms for /tmp/mydhcpd.conf too, but I get the same error.

Hm, may be that is security restriction...

1) For details

tail /var/log/syslog

2) Make sure there is no other dhcp server

ps -ef | grep dhc[p]

I used clean dhcp environment in the example.

3) that INTERFACES env. vaiable is needed (run command with env).

Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28  8:07         ` Sergei Gavrikov
@ 2009-07-28  9:02           ` Mandeep Sandhu
  2009-07-28  9:12             ` Sergei Gavrikov
  0 siblings, 1 reply; 22+ messages in thread
From: Mandeep Sandhu @ 2009-07-28  9:02 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 1:37 PM, Sergei
Gavrikov<sergei.gavrikov@gmail.com> wrote:
> On Tue, Jul 28, 2009 at 01:19:23PM +0530, Mandeep Sandhu wrote:
>> Very strange, I get this error!
>>
>> # dhcpd3 -d -f -cf /tmp/mydhcpd.conf tap0
>> Internet Systems Consortium DHCP Server V3.1.1
>> Copyright 2004-2008 Internet Systems Consortium.
>> All rights reserved.
>> For info, please visit http://www.isc.org/sw/dhcp/
>> Can't open /tmp/mydhcpd.conf: Permission denied
>>
>> # ls -l /tmp/mydhcpd.conf
>> -rwxrwxrwx 1 mandeep mandeep 119 2009-07-28 13:09 /tmp/mydhcpd.conf
>>
>> I've tried with 666 perms for /tmp/mydhcpd.conf too, but I get the same error.
>
> Hm, may be that is security restriction...
>
> 1) For details
>
> tail /var/log/syslog
>
> 2) Make sure there is no other dhcp server
>
> ps -ef | grep dhc[p]
>
> I used clean dhcp environment in the example.

It's clean, as in no other dhcp server daemon was running.

>
> 3) that INTERFACES env. vaiable is needed (run command with env).

It's set in /etc/default/dhcp3-server. Even then I did

export INTERFACES="tap0"

But that did not help. How were you able to get dhcp server running on
an interface which did not have an IP for itself? Won't we have to assign
a static IP addr for the interface on which the dhcp server is listening?
(I assume you were running your server on tap0 i/f?)

I'm thinking I'll assign a static IP to eth0 on the same subnet (10.1.1.0/24)
eg 10.1.1.1. Then run udhcpd on that i/f.

$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:1d:09:54:e6:e3
          inet addr:10.1.1.1  Bcast:10.255.255.255  Mask:255.0.0.0
          UP BROADCAST MULTICAST DYNAMIC  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:17

Now I'll bringup tap0 and run dhclient on it to see if gets an IP addr from
the dhcp server. DHCP packets going out of tap0 should get routed to eth0
right?

How did you get your tap interface up? I'm doing the following:

$ sudo tunctl -u mandeep
Set 'tap0' persistent and owned by uid 1000
mandeep@mindstorm:~$

$ sudo ifup -v tap0
Ignoring unknown interface tap0=tap0.
mandeep@mindstorm:~$

This does not bringup the tap0 i/f. So I use ifconfig instead

$ sudo ifconfig tap0 up

$ ifconfig tap0
tap0      Link encap:Ethernet  HWaddr 26:5d:5f:e5:65:1e
          inet6 addr: fe80::245d:5fff:fee5:651e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:4 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Now I run dhclient on tap0:

$ sudo dhclient -d tap0
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

wmaster0: unknown hardware address type 801
wmaster0: unknown hardware address type 801
Listening on LPF/tap0/26:5d:5f:e5:65:1e
Sending on   LPF/tap0/26:5d:5f:e5:65:1e
Sending on   Socket/fallback
DHCPDISCOVER on tap0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on tap0 to 255.255.255.255 port 67 interval 4
DHCPDISCOVER on tap0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on tap0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on tap0 to 255.255.255.255 port 67 interval 16
DHCPDISCOVER on tap0 to 255.255.255.255 port 67 interval 16
^C

:(

>
> Sergei
>

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28  9:02           ` Mandeep Sandhu
@ 2009-07-28  9:12             ` Sergei Gavrikov
  2009-07-28  9:32               ` Mandeep Sandhu
  2009-07-28 10:15               ` Mandeep Sandhu
  0 siblings, 2 replies; 22+ messages in thread
From: Sergei Gavrikov @ 2009-07-28  9:12 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 02:32:35PM +0530, Mandeep Sandhu wrote:

[snip]

> But that did not help. How were you able to get dhcp server running on
> an interface which did not have an IP for itself? Won't we have to assign
> a static IP addr for the interface on which the dhcp server is listening?
> (I assume you were running your server on tap0 i/f?)

I decribed the steps (re-read that post)

1st) bring up tap0 with static IP address (I did mention how to adopt
/etc/network/interfaces to control tap0 interface)

sudo ifup tap0
ifconfig tap0
...

You must see a static IP for tap0.

and only then 2nd) you have to bring up dhcpd on tap0 again as was
decribed there.


Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28  9:12             ` Sergei Gavrikov
@ 2009-07-28  9:32               ` Mandeep Sandhu
  2009-07-28  9:45                 ` Simon Kallweit
  2009-07-28  9:54                 ` Sergei Gavrikov
  2009-07-28 10:15               ` Mandeep Sandhu
  1 sibling, 2 replies; 22+ messages in thread
From: Mandeep Sandhu @ 2009-07-28  9:32 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 2:42 PM, Sergei
Gavrikov<sergei.gavrikov@gmail.com> wrote:
> On Tue, Jul 28, 2009 at 02:32:35PM +0530, Mandeep Sandhu wrote:
>
> [snip]
>
>> But that did not help. How were you able to get dhcp server running on
>> an interface which did not have an IP for itself? Won't we have to assign
>> a static IP addr for the interface on which the dhcp server is listening?
>> (I assume you were running your server on tap0 i/f?)
>
> I decribed the steps (re-read that post)
>
> 1st) bring up tap0 with static IP address (I did mention how to adopt
> /etc/network/interfaces to control tap0 interface)
>
> sudo ifup tap0
> ifconfig tap0
> ...
>
> You must see a static IP for tap0.
>
> and only then 2nd) you have to bring up dhcpd on tap0 again as was
> decribed there.

But how can we run the server and the client on the same interface?!
(I'm referring
to the test steps you mentioned towards the end...where both
dhcp3-server and the
dhclient use tap0 inetrface). I've not yet gone to configuring ecos
for dhcp since dhcp
is not working.

I configured tap0 with IP 10.1.1.1/24 using the same steps as you mentioned:

$ ifconfig tap0
tap0      Link encap:Ethernet  HWaddr 26:5d:5f:e5:65:1e
          inet addr:10.1.1.1  Bcast:10.1.1.255  Mask:255.255.255.0
          inet6 addr: fe80::245d:5fff:fee5:651e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:39 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Instead of running dhcp3-server, I ran udhcpd with same settings, i.e listening
interface as tap0, and start/end IP as 10.1.1.20 to 30

udhcpd starts fine on tap0.

dhclient on tap0 does not work though

$ sudo dhclient -d tap0
There is already a pid file /var/run/dhclient.pid with pid 9903
removed stale PID file
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

wmaster0: unknown hardware address type 801
wmaster0: unknown hardware address type 801
Listening on LPF/tap0/26:5d:5f:e5:65:1e
Sending on   LPF/tap0/26:5d:5f:e5:65:1e
Sending on   Socket/fallback
DHCPDISCOVER on tap0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on tap0 to 255.255.255.255 port 67 interval 7
^C

Should I try using ecos test prog instead?


>
>
> Sergei
>

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28  9:32               ` Mandeep Sandhu
@ 2009-07-28  9:45                 ` Simon Kallweit
  2009-07-28 11:05                   ` Mandeep Sandhu
  2009-07-28  9:54                 ` Sergei Gavrikov
  1 sibling, 1 reply; 22+ messages in thread
From: Simon Kallweit @ 2009-07-28  9:45 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

Just a little hint I got from the community when I was starting to use 
ethernet on the synth target: I bought a little USB-to-Ethernet adapter, 
so my synth target has it's own physical ethernet interface. Made my 
life quite a bit easier.

Simon

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28  9:32               ` Mandeep Sandhu
  2009-07-28  9:45                 ` Simon Kallweit
@ 2009-07-28  9:54                 ` Sergei Gavrikov
  2009-07-28 11:11                   ` Mandeep Sandhu
  1 sibling, 1 reply; 22+ messages in thread
From: Sergei Gavrikov @ 2009-07-28  9:54 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 03:02:30PM +0530, Mandeep Sandhu wrote:
> But how can we run the server and the client on the same interface?!
> (I'm referring to the test steps you mentioned towards the end...where
> both dhcp3-server and the dhclient use tap0 inetrface). I've not yet
> gone to configuring ecos for dhcp since dhcp is not working.

Mandeep, look on dhclient as on ping_test. It's useless to run eCos
network application if you will not see that dhcp server will offer IP
addresses from 10.1.1.20 ... 10.1.1.30 IP pool (in that example) for
dhclient.

I suggested:

1) run dhcp-server on tap0 (using separate terminal session) after that
when tap0 is configured and up. You will see its log messages on stderr
(-d -f options). Have you set INTERFACES variable?

2) run dhclient for tap0, again (using sepatare terminal session) again
do not forking (-d) and you should see then that dhcp server offers IP
and dhclient get it.

This is that sandbox.

> $ sudo dhclient -d tap0
> There is already a pid file /var/run/dhclient.pid with pid 9903

> Listening on LPF/tap0/26:5d:5f:e5:65:1e
> Sending on   LPF/tap0/26:5d:5f:e5:65:1e
> Sending on   Socket/fallback
> DHCPDISCOVER on tap0 to 255.255.255.255 port 67 interval 5
> DHCPDISCOVER on tap0 to 255.255.255.255 port 67 interval 7

I do not see that client got IP. May be you hit ^C too early?

try again starting  with

sudo killall dhcpd dhcpd3 dhclient dhclient3
sudo ifdown tap0
sudo ifup tap0

1)...

2)...

Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28  9:12             ` Sergei Gavrikov
  2009-07-28  9:32               ` Mandeep Sandhu
@ 2009-07-28 10:15               ` Mandeep Sandhu
  2009-07-28 10:22                 ` Sergei Gavrikov
  1 sibling, 1 reply; 22+ messages in thread
From: Mandeep Sandhu @ 2009-07-28 10:15 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 2:42 PM, Sergei
Gavrikov<sergei.gavrikov@gmail.com> wrote:
> On Tue, Jul 28, 2009 at 02:32:35PM +0530, Mandeep Sandhu wrote:
>
> [snip]
>
>> But that did not help. How were you able to get dhcp server running on
>> an interface which did not have an IP for itself? Won't we have to assign
>> a static IP addr for the interface on which the dhcp server is listening?
>> (I assume you were running your server on tap0 i/f?)
>
> I decribed the steps (re-read that post)
>
> 1st) bring up tap0 with static IP address (I did mention how to adopt
> /etc/network/interfaces to control tap0 interface)
>
> sudo ifup tap0
> ifconfig tap0
> ...
>
> You must see a static IP for tap0.
>
> and only then 2nd) you have to bring up dhcpd on tap0 again as was
> decribed there.

Ok, so it worked with the ecos ping_test! :)

I recompiled ecos with DHCP support and ran the test...

$ ./lwip_tcpip_install/tests/net/common/v3_0/tests/ping_test -nw -io
-t ~/my.tdf
[cyg_net_init] Init: mbinit(0x00000000)
[cyg_net_init] Init: cyg_net_init_devs(0x00000000)
Init device 'synth_eth0'
[cyg_net_init] Init: loopattach(0x00000000)
[cyg_net_init] Init: ifinit(0x00000000)
[cyg_net_init] Init: domaininit(0x00000000)
[cyg_net_init] Init: cyg_net_add_domain(0x02001700)
New domain internet at 0x00000000
[cyg_net_init] Init: cyg_net_add_domain(0x02001140)
New domain route at 0x00000000
[cyg_net_init] Init: call_route_init(0x00000000)
[cyg_net_init] Done
Start PING test
BOOTP[eth0] op: REQUEST
       htype: Ethernet
        hlen: 6
        hops: 0
         xid: 0xe9545202
        secs: 0
       flags: 0x80
       hw_addr: 00:ff:99:c9:52:02
     client IP: 0.0.0.0
         my IP: 10.1.1.20
     server IP: 10.1.1.1
    gateway IP: 0.0.0.0
  options:
        DHCP message: 3 REQUEST
        DHCP server id: 10.1.1.1
        DHCP time 51: 864000
        DHCP option: 37/55.9: 54 51 58 59 1 3 6 15 28
        DHCP option: 39/57.2: 576
        DHCP requested ip: 10.1.1.20
PING server 10.1.1.1
64 bytes from 10.1.1.1: icmp_seq=0, time=0ms
310 bytes from 10.1.1.1: icmp_seq=1, time=0ms
556 bytes from 10.1.1.1: icmp_seq=2, time=0ms
802 bytes from 10.1.1.1: icmp_seq=3, time=10ms
1048 bytes from 10.1.1.1: icmp_seq=4, time=0ms
1294 bytes from 10.1.1.1: icmp_seq=5, time=0ms
1540 bytes from 10.1.1.1: icmp_seq=6, time=0ms
1786 bytes from 10.1.1.1: icmp_seq=7, time=0ms
2032 bytes from 10.1.1.1: icmp_seq=8, time=0ms
2278 bytes from 10.1.1.1: icmp_seq=9, time=0ms
2524 bytes from 10.1.1.1: icmp_seq=10, time=0ms
2770 bytes from 10.1.1.1: icmp_seq=11, time=0ms
3016 bytes from 10.1.1.1: icmp_seq=12, time=0ms
3262 bytes from 10.1.1.1: icmp_seq=13, time=0ms
3508 bytes from 10.1.1.1: icmp_seq=14, time=10ms
3754 bytes from 10.1.1.1: icmp_seq=15, time=0ms
Sent 16 packets, received 16 OK, 0 bad
PING server 10.1.1.33
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out
recvfrom: Operation timed out

Whats this other address that the test uses??? 10.1.1.33?

One more thing...can you verify my understanding of this works
with ecos (i.e the dhcp/ping test)

* The ecos app sends packets via ecos-hal
* ecos hal in-turn uses the ecossynth/rawether process to send the
  packet out.
* The rawether process essentially opens /dev/tap0 (or maybe /dev/net/tun
  with the correct ioctl) and writes the ether frame to it.
* The Linux kernel rx's the frame over tap0 interface
* The Linux nw stack responds to the packet (DHCP/ICMP) and sends out
  the response over tap0.
* When the Linux kernel writes the packet to tap0, the same data becomes
  available on /dev/tap0 (or /dev/net/tun), which is picked up by rawether and
  passed to the ecos process.

Does this summarize the process correctly?

Thanks,
-mandeep

>
>
> Sergei
>

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28 10:15               ` Mandeep Sandhu
@ 2009-07-28 10:22                 ` Sergei Gavrikov
  2009-07-28 11:00                   ` Mandeep Sandhu
  0 siblings, 1 reply; 22+ messages in thread
From: Sergei Gavrikov @ 2009-07-28 10:22 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 03:45:09PM +0530, Mandeep Sandhu wrote:

> Whats this other address that the test uses??? 10.1.1.33?

IMO, that bogus IP just to demo that the dest in unreachable. So, test
passed okay. I think you hit ^C too early in dhclient window :-)

> One more thing...can you verify my understanding of this works
> with ecos (i.e the dhcp/ping test)
> 
> * The ecos app sends packets via ecos-hal
> * ecos hal in-turn uses the ecossynth/rawether process to send the
>   packet out.
> * The rawether process essentially opens /dev/tap0 (or maybe /dev/net/tun
>   with the correct ioctl) and writes the ether frame to it.
> * The Linux kernel rx's the frame over tap0 interface
> * The Linux nw stack responds to the packet (DHCP/ICMP) and sends out
>   the response over tap0.
> * When the Linux kernel writes the packet to tap0, the same data becomes
>   available on /dev/tap0 (or /dev/net/tun), which is picked up by rawether and
>   passed to the ecos process.
> 
> Does this summarize the process correctly?

Perhaps, something likes this, but, I'm not expert here :-(

Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28 10:22                 ` Sergei Gavrikov
@ 2009-07-28 11:00                   ` Mandeep Sandhu
  2009-07-28 11:18                     ` Sergei Gavrikov
  0 siblings, 1 reply; 22+ messages in thread
From: Mandeep Sandhu @ 2009-07-28 11:00 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 3:53 PM, Sergei
Gavrikov<sergei.gavrikov@gmail.com> wrote:
> On Tue, Jul 28, 2009 at 03:45:09PM +0530, Mandeep Sandhu wrote:
>
>> Whats this other address that the test uses??? 10.1.1.33?
>
> IMO, that bogus IP just to demo that the dest in unreachable. So, test
> passed okay. I think you hit ^C too early in dhclient window :-)

I actually waited for more than 2 mins before hitting ^C! :)

The snip that i pasted in the mail was just a test run to get the o/p.

Do you think I should still try and get dhcp to work over tap0?

Regards,
-mandeep

>
>> One more thing...can you verify my understanding of this works
>> with ecos (i.e the dhcp/ping test)
>>
>> * The ecos app sends packets via ecos-hal
>> * ecos hal in-turn uses the ecossynth/rawether process to send the
>>   packet out.
>> * The rawether process essentially opens /dev/tap0 (or maybe /dev/net/tun
>>   with the correct ioctl) and writes the ether frame to it.
>> * The Linux kernel rx's the frame over tap0 interface
>> * The Linux nw stack responds to the packet (DHCP/ICMP) and sends out
>>   the response over tap0.
>> * When the Linux kernel writes the packet to tap0, the same data becomes
>>   available on /dev/tap0 (or /dev/net/tun), which is picked up by rawether and
>>   passed to the ecos process.
>>
>> Does this summarize the process correctly?
>
> Perhaps, something likes this, but, I'm not expert here :-(
>
> Sergei
>

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28  9:45                 ` Simon Kallweit
@ 2009-07-28 11:05                   ` Mandeep Sandhu
  0 siblings, 0 replies; 22+ messages in thread
From: Mandeep Sandhu @ 2009-07-28 11:05 UTC (permalink / raw)
  To: Simon Kallweit; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 3:17 PM, Simon Kallweit<simon.kallweit@intefo.ch> wrote:
> Just a little hint I got from the community when I was starting to use
> ethernet on the synth target: I bought a little USB-to-Ethernet adapter, so
> my synth target has it's own physical ethernet interface. Made my life quite
> a bit easier.

Something like that is my backup plan too!!! :)

I'll connect eth0 on my PC to another PC's eth0 with a cross-cable.
This configuration
already works for me...

Thanks,
-mandeep
>
> Simon
>

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28  9:54                 ` Sergei Gavrikov
@ 2009-07-28 11:11                   ` Mandeep Sandhu
  2009-07-28 11:23                     ` Sergei Gavrikov
  0 siblings, 1 reply; 22+ messages in thread
From: Mandeep Sandhu @ 2009-07-28 11:11 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

> 1) run dhcp-server on tap0 (using separate terminal session) after that
> when tap0 is configured and up. You will see its log messages on stderr
> (-d -f options). Have you set INTERFACES variable?
>
> 2) run dhclient for tap0, again (using sepatare terminal session) again
> do not forking (-d) and you should see then that dhcp server offers IP
> and dhclient get it.

This is where I see a problem. When I ran dhclient on tap0 (_AFTER_
configuring tap0
with a valid static IP addr), I see that the IP addr of tap0 is unset
first and then dhclient
starts sending DHCP DISCOVER packets over it....

Did you observe similar behaviour in your machine too?

Thanks,
-mandeep

>
> This is that sandbox.
>
>> $ sudo dhclient -d tap0
>> There is already a pid file /var/run/dhclient.pid with pid 9903
>
>> Listening on LPF/tap0/26:5d:5f:e5:65:1e
>> Sending on   LPF/tap0/26:5d:5f:e5:65:1e
>> Sending on   Socket/fallback
>> DHCPDISCOVER on tap0 to 255.255.255.255 port 67 interval 5
>> DHCPDISCOVER on tap0 to 255.255.255.255 port 67 interval 7
>
> I do not see that client got IP. May be you hit ^C too early?
>
> try again starting  with
>
> sudo killall dhcpd dhcpd3 dhclient dhclient3
> sudo ifdown tap0
> sudo ifup tap0
>
> 1)...
>
> 2)...
>
> Sergei
>

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28 11:00                   ` Mandeep Sandhu
@ 2009-07-28 11:18                     ` Sergei Gavrikov
  2009-07-28 11:29                       ` Mandeep Sandhu
  0 siblings, 1 reply; 22+ messages in thread
From: Sergei Gavrikov @ 2009-07-28 11:18 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 04:30:39PM +0530, Mandeep Sandhu wrote:
> On Tue, Jul 28, 2009 at 3:53 PM, Sergei
> Gavrikov<sergei.gavrikov@gmail.com> wrote:
> > On Tue, Jul 28, 2009 at 03:45:09PM +0530, Mandeep Sandhu wrote:
> >
> >> Whats this other address that the test uses??? 10.1.1.33?
> >
> > IMO, that bogus IP just to demo that the dest in unreachable. So, test
> > passed okay. I think you hit ^C too early in dhclient window :-)
> 
> I actually waited for more than 2 mins before hitting ^C! :)

Ah, that was odd :-)

> 
> The snip that i pasted in the mail was just a test run to get the o/p.
> 
> Do you think I should still try and get dhcp to work over tap0?

That already works, if your synth eth0 was ethertap tap0. I saw in
test_ping output:

DHCP server id: 10.1.1.1 
                ^^^^^^^^

it is from that example (/etc/netfork/interfacse)

my IP: 10.1.1.20
       ^^^^^^^^^

from my pool (10.1.1.20 ... 10.1.1.30)

etc.

and test pinged server 10.1.1.1 (tap0) successfully. Now set all things
correctly (use more smart dhcpd.conf), use desired IP addresses for
tapN. etc.

Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28 11:11                   ` Mandeep Sandhu
@ 2009-07-28 11:23                     ` Sergei Gavrikov
  0 siblings, 0 replies; 22+ messages in thread
From: Sergei Gavrikov @ 2009-07-28 11:23 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 04:41:24PM +0530, Mandeep Sandhu wrote:
> > 1) run dhcp-server on tap0 (using separate terminal session) after that
> > when tap0 is configured and up. You will see its log messages on stderr
> > (-d -f options). Have you set INTERFACES variable?
> >
> > 2) run dhclient for tap0, again (using sepatare terminal session) again
> > do not forking (-d) and you should see then that dhcp server offers IP
> > and dhclient get it.
> 
> This is where I see a problem. When I ran dhclient on tap0 (_AFTER_
> configuring tap0
> with a valid static IP addr), I see that the IP addr of tap0 is unset
> first and then dhclient
> starts sending DHCP DISCOVER packets over it....
> 
> Did you observe similar behaviour in your machine too?

My sandbox is at home. I cannot confirm that. When I did bring up tap0 I
checked that it has 10.1.1.1 (ifconfig), then ran dhcp server on tap0
and then ran dhclient as a probe.

Sergei


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28 11:18                     ` Sergei Gavrikov
@ 2009-07-28 11:29                       ` Mandeep Sandhu
  2009-07-28 11:37                         ` Sergei Gavrikov
  0 siblings, 1 reply; 22+ messages in thread
From: Mandeep Sandhu @ 2009-07-28 11:29 UTC (permalink / raw)
  To: Sergei Gavrikov; +Cc: ecos-discuss

>>
>> I actually waited for more than 2 mins before hitting ^C! :)
>
> Ah, that was odd :-)
>
>>
>> The snip that i pasted in the mail was just a test run to get the o/p.
>>
>> Do you think I should still try and get dhcp to work over tap0?
>
> That already works, if your synth eth0 was ethertap tap0. I saw in
> test_ping output:

no no...I meant the non-ecos dhcp test...i.e running dhclient over tap0

I know that the ecos synth test passed...it says so at the end of the
test too! :)

Regards,
-mandeep

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

* Re: [ECOS] TAP device not created on running "ping_test"
  2009-07-28 11:29                       ` Mandeep Sandhu
@ 2009-07-28 11:37                         ` Sergei Gavrikov
  0 siblings, 0 replies; 22+ messages in thread
From: Sergei Gavrikov @ 2009-07-28 11:37 UTC (permalink / raw)
  To: Mandeep Sandhu; +Cc: ecos-discuss

On Tue, Jul 28, 2009 at 04:59:24PM +0530, Mandeep Sandhu wrote:
> >> Do you think I should still try and get dhcp to work over tap0?
> >
> > That already works, if your synth eth0 was ethertap tap0. I saw in
> > test_ping output:
> 
> no no...I meant the non-ecos dhcp test...i.e running dhclient over tap0

Well, now you have another "probe" -- any ecos synth net app which uses
dhcp by default. May be dhclient should be configured more smart too.
It worked for me and I did not dig there anymore.

It seems for me, ecos-ref does not point on dhclient. I used it.

Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

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

end of thread, other threads:[~2009-07-28 11:37 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-24  9:39 [ECOS] TAP device not created on running "ping_test" Mandeep Sandhu
2009-07-24 10:53 ` Sergei Gavrikov
2009-07-27  4:54   ` Mandeep Sandhu
2009-07-27 13:44   ` Mandeep Sandhu
2009-07-27 23:26     ` Sergei Gavrikov
2009-07-28  7:16       ` Mandeep Sandhu
2009-07-28  7:49       ` Mandeep Sandhu
2009-07-28  8:07         ` Sergei Gavrikov
2009-07-28  9:02           ` Mandeep Sandhu
2009-07-28  9:12             ` Sergei Gavrikov
2009-07-28  9:32               ` Mandeep Sandhu
2009-07-28  9:45                 ` Simon Kallweit
2009-07-28 11:05                   ` Mandeep Sandhu
2009-07-28  9:54                 ` Sergei Gavrikov
2009-07-28 11:11                   ` Mandeep Sandhu
2009-07-28 11:23                     ` Sergei Gavrikov
2009-07-28 10:15               ` Mandeep Sandhu
2009-07-28 10:22                 ` Sergei Gavrikov
2009-07-28 11:00                   ` Mandeep Sandhu
2009-07-28 11:18                     ` Sergei Gavrikov
2009-07-28 11:29                       ` Mandeep Sandhu
2009-07-28 11:37                         ` Sergei Gavrikov

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 read-only IMAP folder(s) and NNTP newsgroup(s).