Fàilte,
ich versuche jetzt schon seit mehreren Std. einen Rechner als Router einzurichten, was - wie Ihr sicherlich denken koennt, nicht gerade erfolgreich verlaeuft.
Der Aufbau soll wie folgt aussehen:
eth0 - Angeschlossen am Switch, ueber welchen die anderen Rechner dann ins Internet kommen sollen
eth1 - Angeschlossen am DSL-Modem um die Internetverbindung herzustellen.
Ich habe jetzt schon Google mit vielen Fragen gefuettert und vieles ausprobiert. aber nichts davon hatte funktioniert.
Meine letzten Versuche:
Installierte Pakete:
ppp
rp-pppoe
iptables
Konfiguration der Netzwerkkarten:
eth0 Link encap:Ethernet HWaddr 00:1D:60:CE:EE:5E
inet addr:192.168.2.1 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:106 errors:0 dropped:0 overruns:0 frame:0
TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7803 (7.6 Kb) TX bytes:2490 (2.4 Kb)
Interrupt:17 Base address:0xec00
eth1 Link encap:Ethernet HWaddr 00:1D:60:CE:EE:3D
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:121 errors:0 dropped:0 overruns:0 frame:0
TX packets:245 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:7639 (7.4 Kb) TX bytes:16898 (16.5 Kb)
Interrupt:18 Base address:0xe800
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Konfiguration von PPPoE: (Konfiguriert mit "pppoe-setup")
#***********************************************************************
#
# pppoe.conf
#
# Configuration file for rp-pppoe. Edit as appropriate and install in
# /etc/ppp/pppoe.conf
#
# NOTE: This file is used by the pppoe-start, pppoe-stop, pppoe-connect and
# pppoe-status shell scripts. It is *not* used in any way by the
# "pppoe" executable.
#
# Copyright (C) 2000 Roaring Penguin Software Inc.
#
# This file may be distributed under the terms of the GNU General
# Public License.
#
# LIC: GPL
# $Id$
#***********************************************************************
# When you configure a variable, DO NOT leave spaces around the "=" sign.
# Ethernet card connected to DSL modem
ETH='eth1'
# PPPoE user name. You may have to supply "@provider.com" Sympatico
# users in Canada do need to include "@sympatico.ca"
# Sympatico uses PAP authentication. Make sure /etc/ppp/pap-secrets
# contains the right username/password combination.
# For Magma, use xxyyzz@magma.ca
USER='XXXX'
# Bring link up on demand? Default is to leave link up all the time.
# If you want the link to come up on demand, set DEMAND to a number indicating
# the idle time after which the link is brought down.
#DEMAND=300
# DNS type: SERVER=obtain from server; SPECIFY=use DNS1 and DNS2;
# NOCHANGE=do not adjust.
DNSTYPE=NOCHANGE
# Obtain DNS server addresses from the peer (recent versions of pppd only)
# In old config files, this used to be called USEPEERDNS. Changed to
# PEERDNS for better Red Hat compatibility
PEERDNS=no
DNS1=
DNS2=
# Make the PPPoE connection your default route. Set to
# DEFAULTROUTE=no if you don't want this.
DEFAULTROUTE=yes
### ONLY TOUCH THE FOLLOWING SETTINGS IF YOU'RE AN EXPERT
# How long pppoe-start waits for a new PPP interface to appear before
# concluding something went wrong. If you use 0, then pppoe-start
# exits immediately with a successful status and does not wait for the
# link to come up. Time is in seconds.
#
# WARNING WARNING WARNING:
#
# If you are using rp-pppoe on a physically-inaccessible host, set
# CONNECT_TIMEOUT to 0. This makes SURE that the machine keeps trying
# to connect forever after pppoe-start is called. Otherwise, it will
# give out after CONNECT_TIMEOUT seconds and will not attempt to
# connect again, making it impossible to reach.
CONNECT_TIMEOUT=30
# How often in seconds pppoe-start polls to check if link is up
CONNECT_POLL=2
# Specific desired AC Name
ACNAME=
# Specific desired service name
SERVICENAME=dsl.arcor
# Character to echo at each poll. Use PING="" if you don't want
# anything echoed
PING="."
# File where the pppoe-connect script writes its process-ID.
# Three files are actually used:
# $PIDFILE contains PID of pppoe-connect script
# $PIDFILE.pppoe contains PID of pppoe process
# $PIDFILE.pppd contains PID of pppd process
CF_BASE=`basename $CONFIG`
PIDFILE="/var/run/$CF_BASE-pppoe.pid"
# Do you want to use synchronous PPP? "yes" or "no". "yes" is much
# easier on CPU usage, but may not work for you. It is safer to use
# "no", but you may want to experiment with "yes". "yes" is generally
# safe on Linux machines with the n_hdlc line discipline; unsafe on others.
SYNCHRONOUS=no
# Do you want to clamp the MSS? Here's how to decide:
# - If you have only a SINGLE computer connected to the DSL modem, choose
# "no".
# - If you have a computer acting as a gateway for a LAN, choose "1412".
# The setting of 1412 is safe for either setup, but uses slightly more
# CPU power.
CLAMPMSS=1412
#CLAMPMSS=no
# LCP echo interval and failure count.
LCP_INTERVAL=20
LCP_FAILURE=3
# PPPOE_TIMEOUT should be about 4*LCP_INTERVAL
PPPOE_TIMEOUT=80
# Firewalling: One of NONE, STANDALONE or MASQUERADE
FIREWALL=MASQUERADE
# Linux kernel-mode plugin for pppd. If you want to try the kernel-mode
# plugin, use LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so
LINUX_PLUGIN=
# Any extra arguments to pass to pppoe. Normally, use a blank string
# like this:
PPPOE_EXTRA=""
# Rumour has it that "Citizen's Communications" with a 3Com
# HomeConnect DSL Modem DualLink requires these extra options:
# PPPOE_EXTRA="-f 3c12:3c13 -S ISP"
# Any extra arguments to pass to pppd. Normally, use a blank string
# like this:
PPPD_EXTRA=""
########## DON'T CHANGE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING
# If you wish to COMPLETELY overrride the pppd invocation:
# Example:
# OVERRIDE_PPPD_COMMAND="pppd call dsl"
# If you want pppoe-connect to exit when connection drops:
# RETRY_ON_FAILURE=no
Einrichten der "/etc/resolv.conf":
nameserver 145.253.2.19
nameserver 145.253.2.80
nameserver 145.253.3.171
Mein Provider ist Arcor, whois von "arcor.de" gibt folgendes aus:
Nameserver: ns1.arcor-ip.de
Nameserver: ns2.arcor-ip.de
Nameserver: ns3.arcor-ip.de
Ich habe hier alle drei Nameserver angepingt und dort die oben eingetragenen IP's entnommen.
"iptables" NAT-Regel erstellen:
iptables -t nat -A POSTROUTING -s 192.168.2.0 -j MASQUERADE
IP-Forwarding aktivieren:
echo 1 > /proc/sys/net/ipv4/ip_forward
Und anschliessend habe ich die Verbindung mit "pppoe-start" gestartet welche laut Rueckmeldung (.. Connected!) erfolgreich war. Auch taucht die Verbindung bei "ifconfig" auf
ppp0 Link encap:Point-to-Point Protocol
inet addr:88.71.238.154 P-t-P:88.71.224.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:54 (54.0 b) TX bytes:61 (61.0 b)
Dann habe ich die Verbindung mit einem "ping google.de" getestet und war hinterher nicht erfreut zu sehen, das "ping" zu erst lange nichts ausgegeben hatte (~30 Sek) und dann folgende meldung ausgegeben hat: "ping: unknown host google.de"
Dann habe ich ein Ping ueber meinen Laptop gesendet gehabt, die Meldung war die selbe (auch die Wartezeit), aber ich konnte an dem Ping zumindest schon einmal erkennen, das die Pakete an "eth0" gesendet und an "eth1" weitergeleitet werden. Auch hatte das Modem anscheinend die Pakete empfangen (immer wenn ich Pakete sendete, haben die LED's der beiden Netzwerkkarten und auch das LAN-LED am Modem kurz geblinkt). Silbiges auch beim Versuch eine WebSite von Laptop aus zu oeffnen.
Aber das wars dann leider auch schon.
Dann hatte ich in der "pppoe.conf" mal "DNSTYPE=NOCHANGE" in "DNSTYPE=SERVER" geaendert. Anschliessend wurden die von mir eingetragenen Nameserver durch folgende ersetzt:
nameserver 195.50.140.114
nameserver 195.50.140.252
Aber leider bleibt das gesamt Ergebnis unveraendert.
Auch hatte ich es mal mit dem vergeben einer IP an "eth1" probiert, und entsprechende Routings. Was aber auch immer scheiterte, bei einigen sind die vom Laptop aus gesendete Pakete zwar an "eth0" angekommen, wurden aber weder an "eth1" noch an "ppp0" weitergegeben.
Ich habe schon so viel gesucht und probiert, das ich schon gar nicht mehr weiss was ich wie Probiert habe, und es auch Stunden dauern wuerde, alles nieder zu schreiben (und anschliessend zu lesen). Daher schreibe ich nur den letzten Versuch nieder.
Leider scheine ich auch nicht die richtigen Suchbegriffe zu erwischen, jedenfalls habe ich nichts gefunden das mir wirklich hilft (sonst nicht dieser Posting).
Was mache ich falsch oder habe ich vergessen?
MfG
Tox!c Wolf