Mostrando entradas con la etiqueta router. Mostrar todas las entradas
Mostrando entradas con la etiqueta router. Mostrar todas las entradas

viernes, 30 de abril de 2010

vlan configuration - Linux and Cisco Catalyst L2

first install linux PC routernya use, up to want to wear anything ... but if I still use slackware. information, download the VLAN package at http://www.candelatech.com/ ~ greear /



extract tar-zxvf *. tar.gz vlan (make sure the kernel is in use already support 802.1q) "but surely if we are using sekarang2 kernel must have support browww" into the vlan directory and build with the make command .... after the build up vconfig. this program to manage all vlan configurations.
[vlan-0.JPG]

ok ".. do it"

first turn off eth0 on linux pc router [# ifconfig eth0 down], we activate the eth0 interface by giving ip 0.0.0.0 [# ifconfig eth0 0.0.0.0 up].

vlan address configuration information [vconfig add eth0 # 1] order to enable vlan 1, then the system will create a device linux vlan0001.
vlan0001 given ip at [# ifconfig-i vlan0001 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 up]

see by using the command [# ifconfig-a]
command to do the same in well to create another vlan

vlan 2:
# vconfig add eth0 2
# ifconfig-i vlan0002 192.168.2.1 netmask 255.255.255.0 broadcast 192.168.2.255

vlan 3:
# vconfig add eth0 3
# ifconfig-i vlan0003 192.168.3.1 netmask 255.255.255.0 broadcast 192.168.3.255

So much configuration on the linux system, now entered into the console or telnet cisco catalyst, and then give the fa0/24 trunk mode in order to synchronize with a PC eth0 on linux router has the configuration, well here it is the configuration

# conf t

# interface FastEthernet0/24

# duplex full
speed # 100
# switchport trunk encapsulation dot1q
# switchport mode trunk

the right to synchronize between your PC and router linux Catalystnya ... then we stepped into the last event ... ie eating hehehe. ngak wall.
last step we are binding vlan configuration on the PC linux router to an existing port on the Catalyst

vlan 1 on port 1, then we must provide a configuration like this:
# conf t
# interface FastEthernet0 / 1
# duplex half
# switchport access vlan 1
# switchport mode access

vlan 2 on port 2, then we must provide a configuration like this:
# conf t
# interface FastEthernet0 / 2
# duplex half
# switchport access vlan 2
# switchport mode access

vlan port 3 on 3, then we must provide a configuration like this:
# conf t
# interface FastEthernet0 / 3
# duplex half
# switchport access vlan 3
# switchport mode access

finished ..

NOTA: La información fue tomada desde aqui, yo no soy el autor. Sólo que se me hizo algo útil y decidí postearlo.

lunes, 29 de marzo de 2010

Compartir conexión a Internet usando Slackware

Ahora la intención es como lo especifica el título, compartir una conexión a internet a otra PC mediante un cable cruzado, usando nuestro Slackware como un router y una máquina con windows XP como nodo de nuestro router.

OJO, esto lo hice en mi laptop, es decir yo recibo la señal de internet a través de mi tarjeta inalámbrica y lo comparto a través de la tarjeta ethernet (es decir, a través del cable).




SLACKWARE

1).-Sabrás que Slackware tiene instalado por default un script que nos activa el ip_forwarding, el cual está instalado en el directorio: /etc/rc.d/rc.ip_forward, si no tiene permisos de ejecución entraremos en la consola(como root) el comando:
       # chmod +x /etc/rc.d/rc.ip_forward
después ejecutaremos el comando:
                  # /etc/rc.d/rc.ip_forward start

En caso de no tener el script, para activar el ip_forwarding ejecutaremos el comando:
       # echo 1 > /proc/sys/net/ipbv4/ip_forward

Asimismo para desactivarlo(si se requiere), ejecutamos:
       # echo 0 > /proc/sys/net/ipbv4/ip_forward

Cabe resaltar que el ip_forward nos permitirá re-enviar el tráfico de una interfaz de la computadora hacia la otra.

2).- Configurar la interfaz de red (en mi caso se llama eth0) a donde está conectada la computadora con Windows XP, para tal efecto usaremos la red 10.10.1.0/24, definiendo la ip 10.10.1.254/24 para la interfaz eth0(la cual vendrá a ser el default gateway del cliente Windows):
                 
# ifconfig eth0 10.10.1.254/24
                 # route add -net 10.10.1.0 netmask 255.255.255.0 dev eth0

3).- Crear el archivo firewall.sh en el directorio /etc/rc.d/firewall.sh
       # touch /etc/rc.d/firewall.sh
       # chmod +x 
/etc/rc.d/firewall.sh

Después pegar el siguiente contenido dentro del archivo creado anteriormente:
#!/bin/bash
echo -n Aplicando Reglas de Firewall...
## FLUSH de reglas
iptables -F
iptables -X
iptables -Z
iptables -t nat -F

## Establecemos politica por defecto
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT

## Empezamos a filtrar
# Nota: wlan0 es el interfaz conectado al acces point(router inalámbrico) y eth0 a la LAN

iptables -A INPUT -i ! wlan0 -j ACCEPT

# Ahora hacemos enmascaramiento de la red local
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE

Nota: el script no es del todo de mi autoría, sólo lo tomé y lo modifiqué un poco para hacerlo funcionar en mi laptop. La fuente original está en: http://www.forosuse.org/forosuse/archive/index.php/t-3185.html

4).- Ejecutar el script firewall.sh:
          # /etc/rc.d/firewall.sh

Hasta aquí se tiene configurado nuestro Slackware para compartir la conexión a Internet (es decir, funciona como router). 

WINDOWS XP

Ahora ir a la computadora con Windows XP y configurarle los siguientes datos:
IP: 10.10.1.2
Máscara: 255.255.255.0
Default Gateway: 10.10.1.254

DNS primario: 8.8.8.8
DNS secundario(opcional): 8.8.4.4

Para esto ya no entraré en detalle porque es muy sencillo, pero si sigues teniendo problemas aún bajo windows, haz clic aquí para ver cómo se configura una IP estática bajo Windows XP.