0. Konfigurationsskizze:
------------------------
internes Netz hat Adresse: 10.0.0.0
LAN-Adresse BRICK: 10.0.0.20
Adresse FTP-Server: 10.0.0.3
nach "aussen" bekannte Adresse: 199.99.99.1
1. Konfiguration von NAT ausgehend mit dem setup-Tool:
------------------------------------------------------
Konfiguration von NAT (Network Address Translation) ist sehr
einfach
mit dem setup-Tool.
Aufruf von setup. Man erhaelt zum Beispiel folgendes Hauptmenue:
================================================================================
BIANCA/BRICK-XM Setup Tool (c) 1996 by BinTec Communications GmbH
brickxm3
_______________________________________________________________________________
Licenses System
Slot1: CM-BNC/TP, Ethernet
Slot2: CM-1EBRI, ISDN Enhanced S0
Slot3:
IP IPX X.25
ISDN Partner
Configuration Management
Monitoring and Debugging
Exit
================================================================================
Man konfiguriert den ISDN-Partner (z.B. test_partner) wie
gewohnt:
Aus dem Hauptmenue ISDN Partner ---> Add auswaehlen und
gewuenschte Parameter
eintragen.
Dabei ist bei der IP-Konfiguration folgendes zu beachten:
Im Hauptmenue ISDN Partner auswaehlen ----> test_partner
----> IP
==============================================================================
BIANCA/BRICK-XM Setup Tool (c) 1996 by BinTec Communications GmbH
IP Partner Configuration (test_partner) BRICK_XM
_______________________________________________________________________________
IP Transit Network yes
local ISDN IP Address 199.99.99.1
Partner's ISDN IP Address 199.99.99.1
Partner's LAN IP Address
Partner's LAN Netmask
SAVE CANCEL
_______________________________________________________________________________
Use <Space> to select
================================================================================
Hier wird die eigene Adresse (die nach aussen hin bekannte, hier
z.B.
199.99.99.1) eingetragen, um fuer dieses Interface test_partner
eine eigene
nach aussen bekannte Adresse zu definieren.
Man erhaelt dann in der ipRouteTable folgenden Eintrag:
inx Dest(*rw) IfIndex(rw) Metric1(rw) Metric2(rw)
Metric3(rw) Metric4(rw) NextHop(rw) Type(-rw)
Proto(ro) Age(rw) Mask(rw) Metric5(rw)
Info(ro)
00 10.0.0.0 1000 0 0
0 0 10.0.0.20 direct
local 182816 255.0.0.0 0
.0.0
01 199.99.99.1 10001 0 0
0 0 199.99.99.1 direct
local 8655 255.255.255.255 0
Es fehlt nun nur noch eine Default-Route auf das Interface. Auch
das ist
mit dem setup-Tool sehr einfach konfigurierbar. Aus dem
Hauptmenue
IP ---> Routing aufrufen und Defaultroute wie folgt eintragen:
====================================================================================
BIANCA/BRICK-XM Setup Tool (c) 1996 by BinTec Communications GmbH
Add or change IP route BRICK_XM
_______________________________________________________________________________
Route Type Default route
Network WAN without transit network
Partner / Interface test_partner
Metric 1
SAVE CANCEL
_______________________________________________________________________________
Die ipRouteTable sieht dann wie folgt aus:
BRICK_XM:ipNatPresetTable> iproutetable
inx Dest(*rw) IfIndex(rw) Metric1(rw) Metric2(rw)
Metric3(rw) Metric4(rw) NextHop(rw) Type(-rw)
Proto(ro) Age(rw) Mask(rw) Metric5(rw)
Info(ro)
00 10.0.0.0 1000 0 0
0 0 10.0.0.20 direct
local 182816 255.0.0.0 0
.0.0
01 199.99.99.1 10001 0 0
0 0 199.99.99.1 direct
local 8655 255.255.255.255 0
02 0.0.0.0 10001 1 -1
-1 -1 0.0.0.0 indirect
local 10 0.0.0.0 -1
Nun muss NAT noch aktiviert werden:
Man waehlt IP aus ---> Network Address Translation.
Hier kann man dann explizit sagen, fuer welches Interface NAT
eingeschaltet werden
soll (in diesem Fall test_partner):
===============================================================================
BIANCA/BRICK-XM Setup Tool (c) 1996 by BinTec Communications GmbH
NAT Configuration BRICK_XM
_______________________________________________________________________________
Select IP Interface to be configured for NAT
en1
en1-snap
test_partner
EXIT
_______________________________________________________________________________
Press <Ctrl-n>, <Ctrl-p> to scroll, <Return> to
edit/select
===============================================================================
Man schaltet dann einfach NAT auf on:
===============================================================================
BIANCA/BRICK-XM Setup Tool (c) 1996 by BinTec Communications GmbH
Configure NAT (test_partner) brickxm3
_______________________________________________________________________________
Network Address Translation on
Configuration for sessions requested from outside
Service Destination Source Dep. Dest. Dep. Port Remap
ADD DELETE SAVE CANCEL
_______________________________________________________________________________
Use <Space> to select
===============================================================================
Dann wird in der ipExtIfTable folgendes angezeigt:
brickxm3:ipNatTable> 58
inx Index(*ro) RipSend(rw) RipReceive(rw)
ProxyArp(rw) Nat(rw) NatRmvFin(rw)
NatTcpTimeout(rw) NatOtherTimeout(rw) NatOutXlat(rw)
Accounting(rw) TcpSpoofing(rw)
04 10001 ripV1 both
off on <---- yes
3600 30 on
off off
Ist das dann so aktiviert, kommt man ueber Interface 10001
(test_partner)
zwar zum Partner raus, jedoch kommt niemand ueber dieses
Interface ins
interne eigene LAN.
Will man nun auch eingehende Verbindungen erlauben, dann bitte
weiterlesen!
2. Konfiguration von NAT eingehend mit dem setup-Tool
------------------------------------------------------
Will man nun z.B. einen internen FTP-Server auch fuer diesen
Partner
erreichbar machen, muss dies nun explizit erlaubt werden.
Auch das geht mit dem setup-Tool sehr einfach (---> erzeugt
dann Eintraege
in ipNatPresetTable). Man geht wieder auf IP ----> Network
Address Translation
-----> test_partner:
===============================================================================
BIANCA/BRICK-XM Setup Tool (c) 1996 by BinTec Communications GmbH
Edit NAT Configuration (test_partner) BRICK_XM
_______________________________________________________________________________
Service ftp
Destination 10.0.0.3
SAVE CANCEL
_______________________________________________________________________________
Enter IP address (a.b.c.d or resolvable hostname)
===============================================================================
sieht dann wie folgt aus:
===============================================================================
BIANCA/BRICK-XM Setup Tool (c) 1996 by BinTec Communications GmbH
Configure NAT (test_partner) BRICK_XM
_______________________________________________________________________________
Network Address Translation on
Configuration for sessions requested from outside
Service Destination Source Dep. Dest. Dep. Port Remap
ftp 10.0.0.3 no no no
ADD DELETE SAVE CANCEL
_______________________________________________________________________________
Use <Space> to select
===============================================================================
In der ipNatPresetTable wird dann folgender Eintrag angelegt:
BRICK_XM:ipNatPresetTable> ipnatpresettable
inx IfIndex(*rw) Protocol(*-rw) RemoteAddr(rw) RemoteMask(rw)
ExtAddr(rw) ExtMask(rw) ExtPort(*rw) ExtPortRange(rw)
IntAddr(rw) IntPort(rw)
00 10001 tcp 0.0.0.0 0.0.0.0
0.0.0.0 0.0.0.0 21 -1
10.0.0.3 -1
In diesem Falle wuerde jetzt JEDES FTP-Paket, das ueber das
Interface
10001 ankommt, an die 10.0.0.3 weitergeleitet werden. Moechte man
z.B.
dem Partner auch erlauben, einen ping auf die BRICK abzusetzen,
braeuchte man noch folgenden Eintrag:
===============================================================================
BIANCA/BRICK-XM Setup Tool (c) 1996 by BinTec Communications GmbH
Edit NAT Configuration (test_partner) BRICK_XM
_______________________________________________________________________________
Service user defined
Protocol icmp
Port (-1 for any) -1
Destination
SAVE CANCEL
_______________________________________________________________________________
===============================================================================
Der Eintrag sieht dann wie folgt aus:
=============================================================================
BIANCA/BRICK-XM Setup Tool (c) 1996 by BinTec Communications GmbH
Configure NAT (test_partner) BRICK_XM
_______________________________________________________________________________
Network Address Translation on
Configuration for sessions requested from outside
Service Destination Source Dep. Dest. Dep. Port Remap
ftp 10.0.0.3 no no no
icmp 0.0.0.0 no no no
ADD DELETE SAVE CANCEL
_______________________________________________________________________________
===============================================================================
Ausgabe der ipNatPresetTable dann:
BRICK_XM:ipNatPresetTable> ipnatpresettable
inx IfIndex(*rw) Protocol(*-rw) RemoteAddr(rw) RemoteMask(rw)
ExtAddr(rw) ExtMask(rw) ExtPort(*rw) ExtPortRange(rw)
IntAddr(rw) IntPort(rw)
00 10001 tcp 0.0.0.0 0.0.0.0
0.0.0.0 0.0.0.0 21 -1
10.0.0.3 -1
01 10001 icmp 0.0.0.0 0.0.0.0
0.0.0.0 0.0.0.0 -1 -1
0.0.0.0 -1
3. Testen und Ueberpruefen von NAT
----------------------------------
Zum Testen sollte man einen ping auf die Gegenseite absetzen:
BRICK_XM:ipRouteTable> ping 199.99.99.2
PING 199.99.99.2: 64 data bytes
64 bytes from 199.99.99.2: icmp_seq=0. time=777. ms
64 bytes from 199.99.99.2: icmp_seq=1. time=31. ms
64 bytes from 199.99.99.2: icmp_seq=2. time=31. ms
64 bytes from 199.99.99.2: icmp_seq=3. time=31. ms
64 bytes from 199.99.99.2: icmp_seq=4. time=39. ms
----199.99.99.2 PING Statistics----
5 packets transmitted, 5 packets received, 0% packet loss
round-trip (ms) min/avg/max = 31/181/777
Zum Ueberpruefen kann man Syslogausgaben anschauen:
Im Hauptmenue kann man unter System ---> Message level of the
syslog table
auf debug stellen (steht defaultmaessig auf info).
Mit message auf der Kommandoebene erhalten Sie dann z.B.
folgenden Output:
BRICK_XM:biboAdmSyslogTable> message
inx Message(ro)
02 "test_partner: dial number <0911123456>"
03 "B channel layer 1 protocol hdlc 64000 bit/sec"
04 "NAT: new outgoing session on ifc 10001 prot 1
10.0.0.20:3/199.99.99.1:32770 -> 199.99.99.2:0"
<-----------------
05 "sent TRAP(linkUp,0) 117 bytes to circindex 1000 Port
36880"
06 "sent TRAP(linkUp,0) 117 bytes to circindex 10001 Port
36880"
07 "sent TRAP(linkUp,0) 117 bytes to circindex 10008 Port
36880"
08 "sent TRAP(linkUp,0) 117 bytes to circindex 10010 Port
36880"
09 "sent TRAP(linkUp,0) 117 bytes to 10.255.255.255 Port
162"
10 "sent TRAP(linkUp,0) 117 bytes to 255.255.255.255 Port
162"
11 "sent TRAP(linkDown,0) 117 bytes to circindex 1000 Port
36880"
12 "sent TRAP(linkDown,0) 117 bytes to circindex 10001 Port
36880"
13 "sent TRAP(linkDown,0) 117 bytes to circindex 10008 Port
36880"
14 "sent TRAP(linkDown,0) 117 bytes to circindex 10010 Port
36880"
15 "sent TRAP(linkDown,0) 117 bytes to 10.255.255.255 Port
162"
16 "ISDN:
23.01.1997,11:04:03,11:04:28,25,563,589,12,13,0,O,0,362,7/0,9F,0"
17 "stack 0: disconnect cause: normal, unspecified
(0x9f)"
18 "test_partner: outgoing link closed, duration 24 sec, 479
bytes received, 498 bytes sent, 0 charging units"
19 "NAT: delete session on ifc 10001 prot 1
10.0.0.20:3/199.99.99.1:32770 <-> 199.99.99.2:0"
Service Destination Source Dep. Dest. Dep. Port Remap
ftp 10.0.0.3 no no no
icmp 0.0.0.0 no no no
ADD DELETE SAVE CANCEL
_______________________________________________________________________________
===============================================================================
Die ipNatpresetTable sieht dann wie folgt aus:
BRICK_XM:ipNatPresetTable> ipnatpresettable
inx IfIndex(*rw) Protocol(*-rw) RemoteAddr(rw) RemoteMask(rw)
ExtAddr(rw) ExtMask(rw) ExtPort(*rw) ExtPortRange(rw)
IntAddr(rw) IntPort(rw)
00 10001 tcp 0.0.0.0 0.0.0.0
0.0.0.0 0.0.0.0 21 -1
10.0.0.3 -1
01 10001 icmp 0.0.0.0 0.0.0.0
0.0.0.0 0.0.0.0 -1 -1