1/30/2008


Conectarse a Internet a través de un Modem Ethernet ADSL en Arch Linux

Para conectarnos a una conexión ADSL o de Banda Ancha en Arch Linux necesitamos internet, parece una ironía pero es cierto, es algo muy fastidioso y engorroso en esta distribución, no contar con los paquetes básicos para iniciar la conexión por nuestros propios medios, espero que en la próxima version los traigan. Por lo tanto vamos a tener que guardar los paquetes bajados desde otra maquina o de un live cd y copiarlos a esta distribución en un pendrive, diskette o cd.
Otra cosa que me llamo la atención es la carecia de iptables, al tener una conexión dhcp por detrás de un router no le tomé importancia, pero al iniciar una conexión desde mi máquina a Internet y no contar con un cortafuegos en esta época tecnológica es una locura, lo mismo ocurre con MacOSX pero esa es otra historia.

Necesitamos tres paquetes: ppp, rp-pppoe e iptables. Bajarlos desde aquí.
Tengo una conexión adsl a través de speedy(ISP de Telefónica de Argentina).

Los datos necesarios son: Nombre de Usuario
Contraseña
DNS primario y Secundario

Los DNS de Speedy son 200.51.211.7 y 200.51.212.7. Usted debe tener los de su ISP. Puede llamar a la compañia o buscar en google.

Instalamos los paquetes bajados:

[root@ArchLinux no]# tar xvf packadsl.tar
Adsl/
Adsl/rp-pppoe-3.8-2-i686.pkg.tar.gz
Adsl/iptables-1.3.8-2-i686.pkg.tar.gz
Adsl/ppp-2.4.4-6-i686.pkg.tar.gz

# pacman -A iptables-1.3.8-2-i686.pkg.tar.gz

# pacman -A rp-pppoe-3.8-2-i686.pkg.tar.gz

# pacman -A ppp-2.4.4-6-i686.pkg.tar.gz

Una vez instalados, ejecutamos pppoe-setup, los pasos no son difíciles de seguir, deberá introducir los datos que les solicita:

[root@ArchLinux /]# pppoe-setup
Welcome to the Roaring Penguin PPPoE client setup. First, I will run
some checks on your system to make sure the PPPoE client is installed
properly...

Looks good! Now, please enter some information:

USER NAME

>>> Enter your PPPoE user name (default bxxxnxnx@sympatico.ca): USUARIODECONEXION

INTERFACE

>>> Enter the Ethernet interface connected to the DSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethn, where 'n' is a number.
(default eth0): eth0

Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped. If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses. You may have some problems with demand-activated links.
>>> Enter the demand value (default no):

DNS

Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
>>> Enter the DNS information here: 201.51.211.7
Please enter the IP address of your ISP's secondary DNS server.
If you just press enter, I will assume there is only one DNS server.
>>> Enter the secondary DNS server address here: 201.51.212.7

PASSWORD

>>> Please enter your PPPoE password: CONTRASEÑADECONEXION
>>> Please re-enter your PPPoE password: CONTRASEÑADECONEXION

FIREWALLING

Please choose the firewall rules to use. Note that these rules are
very basic. You are strongly encouraged to use a more sophisticated
firewall setup; however, these will provide basic security. If you
are running any servers on your machine, you must choose 'NONE' and
set up firewalling yourself. Otherwise, the firewall rules will deny
access to all standard servers like Web, e-mail, ftp, etc. If you
are using SSH, the rules will block outgoing SSH connections which
allocate a privileged source port.

The firewall choices are:
0 - NONE: This script will not set any firewall rules. You are responsible
for ensuring the security of your machine. You are STRONGLY
recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
for a LAN
>>> Choose a type of firewall (0-2): 1

** Summary of what you entered **

Ethernet Interface: eth0
User name: ******@speedy
Activate-on-demand: No
Primary DNS: 201.51.211.7
Secondary DNS: 201.51.212.7
Firewalling: STANDALONE

>>> Accept these settings and adjust configuration files (y/n)? y
Adjusting /etc/ppp/pppoe.conf
Adjusting /etc/resolv.conf
(But first backing it up to /etc/resolv.conf-bak)
Adjusting /etc/ppp/pap-secrets and /etc/ppp/chap-secrets
(But first backing it up to /etc/ppp/pap-secrets-bak)
(But first backing it up to /etc/ppp/chap-secrets-bak)

Ahora nos falta desactivar la placa de red que utilicemos para la conexión, generalmente es eth0. Editamos /etc/rc.conf y la sección INTERFACES, solo nos tiene que quedar activa "lo", podemos ver que la línea de eth0 esta comentada y en INTERFACES se encuentra el simbolo "!" que la desactiva.

lo="lo 127.0.0.1"
#eth0="eth0 192.168.1.3 netmask 255.255.255.0"
#wlan0="wlan0 up"
INTERFACES=(lo !eth0 !wlan0)

Podemos reiniciar la máquina para que surtan todos los efectos, luego nos conectamos como root:

[root@ArchLinux /]# pppoe-start

....Conected!

Si queremos que cada vez que iniciemos el sistema se conecte, entonces tendremos que agregar "adsl" a la lista de DAEMONS del fichero /etc/rc.conf

DAEMONS=(syslog-ng network netfs crond alsa cups hal adsl)

Estamos conectados!! Espero que les halla servido :). Saludos!

2 comentarios:

Unknown said...

lastima lo de tacher!!! ibas bien...

Braian said...

mmm tacher? no entendi XD