Πως μεσα απο τον DHCP που τρεχει σε εναν router, θα ορισω στατικη IP για ενα host ?
Εμφάνιση 1-15 από 17
-
14-07-19, 07:24 Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #1
-
14-07-19, 09:30 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #2
- Εγγραφή
- 08-01-2004
- Περιοχή
- Espoo, FI
- Ηλικία
- 52
- Μηνύματα
- 21.732
- Downloads
- 41
- Uploads
- 0
- Άρθρα
- 4
- Τύπος
- FTTH
- Ταχύτητα
- 1G/1G
- ISP
- Elisa
- Router
- Unifi Gateway Max
Ανάλογα με το router και την ορολογία που χρησιμοποιεί, η επιλογή (αν υπάρχει) θα εμφανίζεται με διαφορετικό όνομα.
Πολύ συνηθισμένο είναι το DHCP Reservation.Ανυπόγραφος
-
14-07-19, 09:44 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #3Κώδικας:
cisco(config)#ip dhcp ? aaa Configure aaa attributes binding DHCP address bindings bootp BOOTP specific configuration class Configure DHCP classes compatibility Compatibility configuration conflict DHCP address conflict parameters database Configure DHCP database agents excluded-address Prevent DHCP from assigning certain addresses limit Limit DHCP Lease limited-broadcast-address Use all 1's broadcast address ping Specify ping parameters used by DHCP pool Configure DHCP address pools relay DHCP relay agent parameters remember Remember released bindings smart-relay Enable Smart Relay feature support Configure support for certain features update Configure dynamic updates use Configure use of certain parameters during allocation
-
14-07-19, 11:25 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #4
- Εγγραφή
- 08-01-2004
- Περιοχή
- Espoo, FI
- Ηλικία
- 52
- Μηνύματα
- 21.732
- Downloads
- 41
- Uploads
- 0
- Άρθρα
- 4
- Τύπος
- FTTH
- Ταχύτητα
- 1G/1G
- ISP
- Elisa
- Router
- Unifi Gateway Max
Α, δεν είχα δει ότι πρόκειται για Cisco.
Πάει καιρός που ασχολήθηκα με τέτοια μαραφέτια. Τον καιρό εκείνο θυμάμαι/νομίζω ότι για κάθε συσκευή/ΙΡ που ήθελα σταθερή ΙΡ μέσω DHCP έφτιαχνα ένα ξεχωριστό DHCP pool και όριζα την επιθυμητή ΙΡ και το client identifier της συσκευής.
Μάλλον θα πρέπει να μας φωτίσει κάποιος που έχει πιο φρέσκιες γνώσεις στα Cisco.
-
14-07-19, 12:50 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #5
και εγω κατι τετοιο διαβασα. αλλα απο την θεωρια μεχρι την υλοποίηση υπαρχει μια αποσταση.
by the way, ειπα να ασχοληθω λιγο με την cisco τεχνολογια. οσο εκανα κανα lab ηταν ολα καλα μιας και το συνολο των συσκευων ηταν της ιδιας εταιριας.
οταν ειπα να βαλω εναν cisco router στο δικτυο μου, μαζι με τα mikrotik δηλαδη, ειδα οτι δεν ειναι και το πιο ευκολο πραγμα. πραγματα που εκανα δηλαδη με δυο mikrotik, δεν μπορω να τα κανω με ενα MK και εναν Cisco. Δεν λεω οτι δεν γινεται, απλα λεω οτι δεν ειναι τοσο ευκολο και ξεκαθαρο.
-
14-07-19, 16:42 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #6Κώδικας:
CISCO# config t CISCO(config)# ip dhcp pool MyHost CISCO(dhcp-config)# host 10.0.99.15 255.255.255.0 CISCO(dhcp-config)# client-identifier 0194.39e5.c0c2.a9 CISCO(dhcp-config)# default-router 10.0.99.1 CISCO(dhcp-config)# dns-server 10.0.0.1 10.0.1.1 CISCO(dhcp-config)# end
host: διεύθυνση IP για αυτόν τον υπολογιστή (host)
client-identifier: ορίζει τη διεύθυνση MAC στην οποία δεσμευόμαστε
default-router: Default gateway
dns-server: DNS servers
Πολύ προσεκτικά τη γραμμή client-identifier. Βλέπετε, για κάποιο λόγο, η διεύθυνση MAC είναι περισσότερο από ό, τι θα έπρεπε να είναι; Το γεγονός είναι ότι μπροστά το "01" (στην πραγματικότητα, η MAC φαίνεται 94: 39: E5: C0: C2: A9). Το γεγονός είναι ότι κατά τη διάρκεια μιας αίτησης για μια Cisco, ένα MAC έρχεται σε αυτή τη μορφή, δηλ. με "01" στην αρχή. Φτάνει με τον ίδιο τρόπο από τα Windows, με τα συστήματα Unix, πρώτα "00" αντί "01".Τελευταία επεξεργασία από το μέλος euri : 14-07-19 στις 16:46. Αιτία: προσθήκη [code] tags για καλύτερη απεικόνιση του κώδικα
-
14-07-19, 17:33 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #7
Βασικα δεν τα καταφερα. δυστυχως. η συσκευη ηταν ενα raspberry pi3 και το εκανα μεσα απο εκει. απλα θα ηθελα να φαινεται μεσα απο το Cisco.
Βρηκα και ακολουθησα το παρακατω
Κώδικας:DHCP STATIC IP 1- Router(config)# ip dhcp pool Test 2- Router(dhcp-config)# host 192.168.1.22 255.255.255.0 3-Router(dhcp-config)# client-identifier unique-identifier
και οπου client-identifier unique-identifier εβαλα την MAC address.
μετα το reboot ειδα οτι ειχε κανει δυο εγγραφες. μια που ελεγε automatic και μια με Manual. μονο που στην automatic ειχε βαλει και ενα 01.
εκανα ξανα την εγγραφη της MAC με το 01 αυτη την φορα αλλα δεν εγινε κατι. μετα αρχισα να το χανω και δεν το εμπιστευομουν.
Υ.Γ. τωρα που βλεπω τις διευθυνσεις που μοιραζει ο dhcp, παρατηρω οτι υπαρχει μηχανημα το οποιο εχεις παρει IP την οποια μπορω να την κανω ping αλλα δεν φαινεται μεσα στο sh ip dhcp binding. Γιατι ;;Τελευταία επεξεργασία από το μέλος geioannou : 14-07-19 στις 18:54.
-
14-07-19, 20:30 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #8
Βγάλε manual IP για να πάρει αυτόματα IP απο το router αφού το έβαλες εκεί
-
14-07-19, 21:37 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #9
-
15-07-19, 09:47 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #10
Το πώς φτάνει το client-id στον dhcp server εξαρτάται από το σύστημα που στέλνει το request. Συνήθως, είναι 01 ακολουθούμενο από τη mac address, όπως έχει αναφερθεί ήδη.
Πέρα αυτού, έχε στο νου σου ότι αν δεν ορίσεις στο μηχάνημα ότι θες να σώζει τα bindings persistently, τα χάνει μετά από κάθε reboot.In theory, practice is the same as theory.
In practice, it isn't.
-
15-07-19, 10:56 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #11
εαν δηλαδη γινει reboot στο μηχανημα και χασει τα bindings persistently τοτε αφου τα host διατηρούν τις IP τους, δεν θα αναγραφεται τιποτα στο DHCP ?
Θα γραφτει παλι κατι, στην επομενη επανεκινηση των host ?
-
15-07-19, 11:03 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #12
Σωστά. Θα γραφτεί κάτι όταν οι host κάνουν renew το lease. Εναλλακτικά μπορείς όπως είπα νέα του ορίσεις να τα σώζει persistently σε κάποιο αρχείο, οπότε θα τα θυμάται μετά από reboot.
-
24-07-19, 16:29 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #13
Για να ρυθμίσεις τον DHCP server στον CISCO router σου, πρέπει να φτιάξεις ένα ξεχωριστό pool για κάθε συκευή που θέλεις να παίρνει συγκεκριμένο IP απο τον router.
Για παράδειγμα:
!
!
ip dhcp excluded-address 10.1.29.1
ip dhcp excluded-address 10.1.29.2 10.1.29.99
ip dhcp excluded-address 10.1.29.201 10.1.29.255
ip dhcp excluded-address 192.168.69.254
ip dhcp excluded-address 192.168.69.1 192.168.69.101
ip dhcp excluded-address 192.168.69.151 192.168.69.253
!
ip dhcp pool VOICE_LAN <--------- DHCP server για το SIP VOICE
network 10.1.29.0 255.255.255.0
default-router 10.1.29.2
dns-server 10.1.29.2
option 150 ip 10.1.29.2
domain-name somenet.prv
option 66 ip 10.1.29.2
!
ip dhcp pool LOC_LAN <--------------- DHCP Server για ΟΛΑ τα μηχανήματα που χρειάζεται να πάρουν μια τυχαία IP
network 192.168.69.0 255.255.255.0
domain-name somenet.prv
default-router 192.168.69.254
dns-server 8.8.8.8 1.1.1.1 8.8.4.4 1.0.0.1
!
ip dhcp pool REMOTE1 <--------------- DHCP Server για το μηχάνημα με MAC address 807d.3a18.75ad
host 192.168.69.221 255.255.255.0 <---- Η IP που θέλεις να πάρει το συγκεκριμένο μηχάνημα
hardware-address 807d.3a18.75ad <---- Η MAC address του μηχανήματος (ΧΩΡΙΣ το 01 μπροστά)
client-name ESP_1875AD_REMOTE_1 <---- ΤΥΧΑΙΟ όνομα που δίνεις στην συσκευή σου
domain-name somenet.prv
!
ip dhcp pool REMOTE2 <--------------- DHCP Server για το μηχάνημα με MAC address dc4f.2286.d2f4
host 192.168.69.222 255.255.255.0 <---- Η IP που θέλεις να πάρει το συγκεκριμένο μηχάνημα
hardware-address dc4f.2286.d2f4 <---- Η MAC address του μηχανήματος (ΧΩΡΙΣ το 01 μπροστά)
client-name ESP_1875AD_REMOTE_2 <---- ΤΥΧΑΙΟ όνομα που δίνεις στην συσκευή σου
domain-name somenet.prv
!
ΠΡΟΣΟΧΗ: Η IP που θα δώσεις μέσα από τα MAC binding pools ΠΡΕΠΕΙ να είναι "EXCLUDED" από τα IP που δίνει ο DHCP Server στα άλλα μηχανήματα.
- - - Updated - - -
Η εντολή "client-identifier" στον Cisco DHCP Server περιμένει να "δει" τον αριθμό πελάτη που στην ουσία είναι η MAC address της συσκευής που κάνει το IP request και μπροστά έχει κολλημένο τον αριθμό 01. Δηλαδή, για μια συσκευή με MAC address dc4f.2286.d2f4, το "client-identifier" νούμερο είναι 01dc.4f22.86d2.f4
Στον DHCP Server του router είναι πιο σωστό να χρησιμοποιούμε την εντολή "hardware-address" με την MAC Address του μηχανήματος και ΟΧΙ την εντολή "client-identifier"
.
-
21-09-19, 10:56 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #14
-
21-09-19, 11:14 Απάντηση: Πως μεσα απο τον DHCP θα ορισω στατικη IP για ενα host ? #15
Μάλλον κάνεις λάθος. Φυσικά βέβαια μπορούν να χρησιμοποιηθούν και οι δύο τύποι, αλλά η cisco προτείνει το "hardware-address" στο configuration του DHCP static address mapping.
https://www.cisco.com/c/en/us/td/doc...A-6B977196D35C
Configuring DHCP Static Mapping
The DHCP Static Mapping feature enables the assignment of static IP addresses (without creating numerous host pools with manual bindings) by using a customer-created text file that the DHCP server reads. The benefit of this feature is that it eliminates the need for a long configuration file and reduces the space required in NVRAM to maintain address pools.
A DHCP database contains the mappings between a client IP address and the hardware address, which is referred to as a binding. There are two types of bindings: manual bindings that map a single hardware address to a single IP address, and automatic bindings that dynamically map a hardware address to an IP address from a pool of IP addresses. Manual (also known as static) bindings can be configured individually directly on the device or by using the DHCP Static Mapping feature. These static bindings can be read from a separate static mapping text file. The static mapping text files are read when a device reloads or the DHCP service restarts. These files are read-only.
The read static bindings are treated just like the manual bindings, in that they are:
Retained across DHCPRELEASEs from the clients.
Not timed out.
Deleted only upon deletion of the pool.
Provided appropriate exclusions for the contained addresses, which are created at the time of the read.
Just like automatic bindings, manual (or static) bindings from the static mapping text file are also displayed by using the show ip dhcp binding command.
Perform this task to create the static mapping text file. You will input your addresses in the text file, which is stored in the DHCP database for the DHCP server to read. There is no limit to the number of addresses that can be stored in the file. The file format has the following elements:
Database version number
End-of-file designator
Hardware type
Hardware address <---------------------
IP address
Lease expiration
Time the file was created
See the following table for more details about the format of the text file.
The following is a sample static mapping text file:
*time* Jan 21 2005 03:52 PM
*version* 2
!IP address Type Hardware address Lease expiration
10.0.0.4 /24 1 0090.bff6.081e Infinite
10.0.0.5 /28 id 00b7.0813.88f1.66 Infinite
10.0.0.2 /21 1 0090.bff6.081d Infinite
*end*
Table 1 Static Mapping Text File Field Descriptions
Field
Description
*time*
Specifies the time the file was created. This field allows DHCP to differentiate between the new and old database versions when multiple agents are configured. The valid format of the time is mm dd yyyy hh:mm AM/PM.
*version* 2
Specifies the database version number.
IP address
Specifies the static IP address. If the subnet mask is not specified, a mask is automatically assigned depending on the IP address. The IP address and the mask is separated by a space.
Type
Specifies the hardware type. For example, type “1” indicates Ethernet. The type “id” indicates that the field is a DHCP client identifier. Legal values can be found online at http://www.iana.org/assignments/arp-parameters in the “Number Hardware Type” list.
Hardware address
Specifies the hardware address.
When the type is numeric, the type refers to the hardware media. Legal values can be found online at http://www.iana.org/assignments/arp-parameters in the “Number Hardware Type” list.
When the type is “id,” the type refers to a match on the client identifier.
For more information about the client identifier, see RFC 2132, DHCP Options and BOOTP Vendor Extensions, section 9.14, located at http://www.ietf.org/rfc/rfc2132.txt, or the client-identifier command.
If you are unsure about the client identifier to match with the hardware type, use the debug dhcp detail command to display the client identifier being sent to the DHCP server from the client.
Lease expiration
Specifies the expiration of the lease. “Infinite” specifies that the duration of the lease is unlimited.
*end*
End of file. DHCP uses the *end* designator to detect file truncation.
Configuring the DHCP Server to Read a Static Mapping Text File
Configuring the DHCP Server to Read a Static Mapping Text File
Before You Begin
The administrator must create the static mapping text file in the correct format and configure the address pools before performing this task.
Before editing the file, you must disable the DHCP server using the no service dhcp command.
Bookmarks