|
nit.cat
|
|
13/10 - 03:41 CEST
inici
|
ADSL
#!/bin/sh
# Configuració ADSL TELEFONICA DATA ROUTER EXTERN
#
# Copyright (c) 2000 Sergi Coll ( sergi (at) sim00 (dot) net )
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
# Configuració de les tarjetes de xarxa
#
# L'ordre de les tarjes ve donat pel kernel
ifconfig eth0 192.168.0.x netmask 255.255.255.0 up
ifconfig eth1 212.170.12.x broadcast 212.170.12.63 netmask 255.255.255.192 up
# eth1 està conectada via un CROSS-OVERED cable al router ADSL
# les IP's de la eth1 haurien de ser assignades via DHCP
# Important el hostname de la màquina segons TELEFONICA sino és el mateix
# no entrega la IP al router.
# Router Linux
echo 1 >/proc/sys/net/ipv4/ip_forward
# Després s'han de carregar els mòduls ip_masq del Kernel que és vulguin
modprobe ip_masq_ftp
ipchains -A forward -i eth1 -j MASQ -s 192.168.10.0/24
# eth1 ^ ipchains ^ eth0
# | <----------> |
# Ethernet de la ADSL --- ------ Xarxa Local
# Taula d'enrutament
route add -net 192.168.0.0 netmask 255.255.255.0 dev eth0 # Xarxa Local
route add -net 212.170.12.x netmask 255.255.255.192 dev eth1 # Xarxa vàlida per ADSL
route add default gw 212.170.12.1 # Gateway ADSL que necessita una IP vàlida
# que li dona la xarxa de la tarja eth1
# pel DNS es modicica el fitxer /etc/resolv.conf
#
# nameserver dns_TIMO
Última modificació / Last update: 07/10/03