User Tools

Site Tools


informatica:linux:red:configuracion_interfaz

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
informatica:linux:red:configuracion_interfaz [2007/11/19 14:34] 87.218.223.120informatica:linux:red:configuracion_interfaz [2015/04/13 20:19] (current) – external edit 127.0.0.1
Line 1: Line 1:
-**IP FIJA**\\ +====== Configurar interfaces de red ======
-Fichero /etc/network/interfaces \\  +
-iface eth0 inet static \\ +
-address 192.168.1.2 \\ +
-netmask 255.255.255.0 \\ +
-gateway 192.168.1.1  \\+
  
-NOTA: tras realizar los cambios, reiniciar todas las interfaces:+ifconfig dhclient3 ifup ifdown iwconfig
  
-/etc/init.d/networking restart+En esta sección se detalla información acerca de distintas formas de configurar redes en entornos debian 
 + 
 +===== Equivalencia comandos ===== 
 + 
 +En estos ejemplos asumimos que queremos configurar la interfaz 'eth0': 
 + 
 +^ Operación ^ Linux ^ Windows ^ 
 +| Solicitar ip a un servidor DHCP | dhclient3 eth0 | ipconfig /renew | 
 +| Liberar la ip | dhclient3 -r eth0 | ipconfig /release | 
 +| Desconfigurar la interfaz | ifdown eth0 | - | 
 +| Volverla a configurar, con arrego a /etc/interfaces | ifup eth0 | - | 
 + 
 + 
 + 
 +===== Ip estática para interfaz ethernet ===== 
 + 
 +**IP FIJA** 
 + 
 +<code> 
 +auto lo 
 +iface lo inet loopback 
 +allow-hotplug eth0 
 +iface eth0 inet static 
 +address 192.168.1.2 
 +netmask 255.255.255.0 
 +gateway 192.168.1.1 
 +dns-nameservers 192.168.1.1 
 +auto eth0 
 +</code> 
 + 
 +NOTA: la entrada "dns-nameservers" es necesaria por ejemplo en Ubuntu Server, porque los cambios en el archivo "/etc/resolv.conf" son sobre-escritos tras cada reinicio. 
 + 
 +Tras realizar los cambios, reiniciar todas las interfaces: 
 + 
 +  /etc/init.d/networking restart
  
 **IP DINÁMICA**\\ **IP DINÁMICA**\\
Line 19: Line 48:
 **Servidor DNS**\\ **Servidor DNS**\\
 /etc/resolv.conf /etc/resolv.conf
 +
 +
 +
 +===== Comandos útiles =====
 +
 +Deshabilitar una interfaz (de paso libera la ip):
 +
 +  ifdown eth0
 +
 +Levantar una interfaz (si así estuviera configurada, buscaría un servidor DHCP):
 +
 +  ifup eth0
 +
 +Asignar una puerta de enlace a una interfaz:
 +
 +  route add default gw 192.168.1.1 eth0
 +
 +Configurar manualmente una interfaz:
 +
 +  ifconfig eth0 192.168.1.100 netmask 255.255.255.0
 +
 +
 +===== WPA-PSK and WPA2-PSK - DHCP =====
 +
 +Requisito: wpasupplicant -> http://packages.debian.org/squeeze/wpasupplicant
 +Instrucciones: http://wiki.debian.org/WiFi/HowToUse#Command_Line
 +
 +===== Asignar varias IPs en una NIC =====
 +
 +Tenemos una NIC (eth0) y queremos asignarle una segunda IP:
 +
 +  sudo ifconfig eth0.2 10.0.0.99/24 up
 +====== Rutas ======
 +auto eth0
 +iface eth0 inet static
 + address 10.139.66.209
 + netmask 255.255.255.192
 + up route add -net 10.0.0.0 netmask 255.0.0.0 gw 10.139.66.193
 +
 +
 +auto eth1
 +iface eth1 inet static
 + address 172.16.33.9
 + netmask 255.255.255.0
 + gateway 172.16.33.1
 +
 +
 +===== 2 gateways =====
 +
 +Escenario:
 +
 +  * Servidor con dos interfaces de red, subredes y enrutadores distintos: "local" y "dmz"
 +  * Queremos acceder desde la DMZ
 +  * Queremos que el enrutador por defecto siga siendo "local"
 +
 +
 +
 +
informatica/linux/red/configuracion_interfaz.1195482885.txt.gz · Last modified: 2015/04/13 20:19 (external edit)