Quick
index
main
eev
maths
blogme
dednat4
littlelangs
PURO
(GAC2,
λ, etc)
(Chapa 1)

emacs
lua
(la)tex
fvwm
tcl
forth
icon
debian
irc
contact

Tentando configurar um Debian Lenny pra usar NET Virtua

O Virtua está funcionando num computador com W$ - não precisou de configuração nenhuma pra funcionar lá - mas ainda não consegui pô-lo pra funcionar no Debian (Lenny).

Pra confirmar que eu não tinha algo estranho no meu Lenny atrapalhando tudo, testei dar um boot com um DVD de instalação da Debian Etch (anterior ao Lenny; não achei o DVD do Lenny). O DVD de instalação tentou configurar a rede automaticamente, mas não conseguiu.


Tentativa 1: dhclient

As instruções desta página - http://dicaslinux.wordpress.com/2008/09/21/net-virtua-no-debian-dhcpcable/ - não funcionam: o dhclient falha. Aqui está um output típico de quando eu rodo "dhclient eth0" (desta vez ele teve que matar um dhclient anterior; o output quando não há um dhclient anterior rodando tem algumas coisas a menos):

There is already a pid file /var/run/dhclient.pid with pid 3455
killed old client process, removed 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/

Listening on LPF/eth0/00:1c:c0:98:cd:9a
Sending on   LPF/eth0/00:1c:c0:98:cd:9a
Sending on   Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 15
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 5
No DHCPOFFERS received.
Trying recorded lease 192.168.1.2
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.

--- 192.168.1.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

No working leases in persistent database - sleeping.


Tentativa 2: dhcpcd

Em alguma página que eu encontrei na rede sobre configuração do Debian pra usar o Virtua (qual? Perdi o link...) recomendavam que se usasse o dhcpcd. Eu rodei "SET_DNS=yes dhcpcd -d eth0" e o output foi este:

info, eth0: dhcpcd 3.2.3 starting
info, eth0: hardware address = 00:1c:c0:98:cd:9a
info, eth0: removing IP address 192.168.1.2/24
info, eth0: DUID = 00:01:00:01:13:df:34:54:00:1c:c0:98:cd:9a
info, eth0: broadcasting for a lease
debug, eth0: sending DHCP_DISCOVER with xid 0x6848fe9c
debug, eth0: waiting for 20 seconds
debug, eth0: sending DHCP_DISCOVER with xid 0x6848fe9c
debug, eth0: sending DHCP_DISCOVER with xid 0x6848fe9c
debug, eth0: sending DHCP_DISCOVER with xid 0x6848fe9c
debug, eth0: ignoring packet with xid 0xfae61b76 as it's not ours (0x6848fe9c)
debug, eth0: sending DHCP_DISCOVER with xid 0x6848fe9c
debug, eth0: waiting for 8 seconds
debug, eth0: sending DHCP_DISCOVER with xid 0x6848fe9c
debug, eth0: ignoring packet with xid 0xfae61b76 as it's not ours (0x6848fe9c)
debug, eth0: waiting for 4 seconds
debug, eth0: ignoring packet with xid 0xe2284219 as it's not ours (0x6848fe9c)
debug, eth0: waiting for 3 seconds
debug, eth0: ignoring packet with xid 0xe2284219 as it's not ours (0x6848fe9c)
debug, eth0: sending DHCP_DISCOVER with xid 0x6848fe9c
debug, eth0: waiting for 2 seconds
err, eth0: timed out
info, eth0: trying to use old lease in `/var/lib/dhcpcd/dhcpcd-eth0.info'
err, eth0: lease information file `/var/lib/dhcpcd/dhcpcd-eth0.info' does not exist
info, eth0: probing for an IPV4LL address
debug, eth0: sending ARP probe #1
debug, eth0: sending ARP probe #2
debug, eth0: sending ARP probe #3
debug, eth0: sending ARP claim #1
debug, eth0: sending ARP claim #2
warn, eth0: using IPV4LL address 169.254.131.80
info, eth0: adding IP address 169.254.131.80/16
debug, eth0: no dns information to write
debug, eth0: writing /var/lib/dhcpcd/dhcpcd-eth0.info
debug, eth0: exec "/etc/dhcpcd.sh" "/var/lib/dhcpcd/dhcpcd-eth0.info" "new"
debug, eth0: forking to background
info, eth0: exiting
dhcpcd.sh: interface eth0 has been configured with new IP=169.254.131.80

Aparentemente o dhcpcd conseguiu configurar a conexão, mas e agora? Se eu tento acessar o mundo exterior pelo Firefox ele não consegue... acho que o problema é o que está sendo reportado pela linha "no dns information to write" no log acima - será que eu não estou recebendo os endereços dos DNS servers do Virtua?

Se eu rodo isto aqui depois do "SET_DNS=yes dhcpcd -d eth0",

ifconfig
route
cat /etc/resolv.conf
cat /var/lib/dhcpcd/dhcpcd-eth0.info
ps ax | grep dhcpcd-bin

o output é:

/home/edrx(root:pe)# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1c:c0:98:cd:9a  
          inet addr:169.254.74.75  Bcast:169.254.255.255  Mask:255.255.0.0
          inet6 addr: fe80::21c:c0ff:fe98:cd9a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:111686 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14272 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12928723 (12.3 MiB)  TX bytes:2539335 (2.4 MiB)
          Interrupt:219 Base address:0x4000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:546 errors:0 dropped:0 overruns:0 frame:0
          TX packets:546 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:45987 (44.9 KiB)  TX bytes:45987 (44.9 KiB)

/home/edrx(root:pe)# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
link-local      *               255.255.0.0     U     0      0        0 eth0
/home/edrx(root:pe)# cat /etc/resolv.conf
### BEGIN INFO
#
# Modified_by:  NetworkManager
# Process:      /usr/bin/NetworkManager
# Process_id:   2704
#
### END INFO

nameserver 192.168.1.1

/home/edrx(root:pe)# cat /var/lib/dhcpcd/dhcpcd-eth0.info
IPADDR='169.254.74.75'
NETMASK='255.255.0.0'
NETWORK='169.254.0.0'
BROADCAST='169.254.255.255'
LEASEDFROM='0'
LEASETIME='20'
RENEWALTIME='10'
REBINDTIME='17'
INTERFACE='eth0'
CLASSID='dhcpcd 3.2.3'
CLIENTID='ff:65:74:68:30:00:01:00:01:13:df:34:54:00:1c:c0:98:cd:9a'
DHCPCHADDR='00:1c:c0:98:cd:9a'

# dhcpcd-1.x and 2.x compatible variables
/home/edrx(root:pe)# ps ax | grep dhcpcd-bin
 5692 ?        Ss     0:00 /sbin/dhcpcd-bin -h persephone -Y -N -d eth0
/home/edrx(root:pe)# 


Obs: SET_DNS=yes

Uma observação. No Debian o /sbin/dhcpcd é um shell script, que começa assim:

#!/bin/bash

# dhcpcd doesn't support a config file, just command line options.
# ifup can set some  options (-h -i -I -l) but no others.
# This wrapper adds any other options set in /etc/default/dhcpcd
# (and the hostname if not set by ifup or /etc/default/dhcpcd)
# and then calls the dhcpcd binary, named dhcpcd-bin.
#
# Note that this wrapper _requires_ the interface name: it doesn't support
# the eth0 default that dhcpcd proper does.

No início eu estava rodando só "dhcpcd -d eth0", mas aí eu descobri (com "ps ax") que ele estava invocando o dhcpcd-bin deste modo:

5304 ?        Ss     0:00 /sbin/dhcpcd-bin -h persephone -R -Y -N -d eth0

A manpage do dhcpcd-bin diz isto aqui sobre a opção "-R":

-R, --nodns
             Don't send DNS information to resolvconf or touch /etc/resolv.conf.

Por causa disso eu passei a rodar "SET_DNS=yes dhcpcd -d eth0" ao invés de só "dhcpcd -d eth0" - o truque vem deste trecho de código aqui, no /sbin/dhcpcd:

# Note that in the absence of /etc/default/dhcpcd we play safe and disallow
# changes to /etc/resolv.conf and friends.

if [ "$SET_DNS" != "yes" ]; then
  OPTIONS="-R $OPTIONS"
fi

só que mesmo assim o meu problema continua - continuo recebendo "no dns information to write" quando rodo o dhcpcd, e o DNS não é setado... 8-\


Etc:

Alguns links sobre dhcpcd:
  http://www.phystech.com/download/dhcpcd.html  (aqui diz que ele suporta Virtua)
  http://www.phystech.com/download/dhcpcd_man.html
  http://wiki.linuxquestions.org/wiki/Dhcpcd
  http://www.faqs.org/rfcs/rfc2131.html
  http://www.faqs.org/rfcs/rfc1541.html
  http://groups.google.com/group/android-porting/browse_thread/thread/1abf63824e56dddc

Por sinal: quando eu me conecto pelo Velox (usando "pon dsl-provider"; na verdade eu uso shell functions chamadas "pp"/"ppp"/"pppp", definidas aqui) o log (isto é, o output do plog) diz isto aqui:

Jul 25 21:26:09 persephone pppd[4177]: Warning - secret file /etc/ppp/pap-secrets has world and/or group access
Jul 25 21:26:09 persephone pppd[4177]: Warning - secret file /etc/ppp/pap-secrets has world and/or group access
Jul 25 21:26:10 persephone pppd[4177]: PAP authentication succeeded
Jul 25 21:26:10 persephone pppd[4177]: peer from calling number 00:90:1A:42:8F:F2 authorized
Jul 25 21:26:10 persephone pppd[4177]: replacing old default route to eth0 [192.168.1.1]
Jul 25 21:26:10 persephone pppd[4177]: Cannot determine ethernet address for proxy ARP
Jul 25 21:26:10 persephone pppd[4177]: local  IP address 201.19.84.186
Jul 25 21:26:10 persephone pppd[4177]: remote IP address 200.217.72.22
Jul 25 21:26:10 persephone pppd[4177]: primary   DNS address 200.149.55.142
Jul 25 21:26:10 persephone pppd[4177]: secondary DNS address 200.165.132.154