DHCP JUNOS

From Teknologisk videncenter
Revision as of 18:16, 11 January 2015 by Rael (talk | contribs) (Created page with "=DHCP Server= Som så mange andre netværks enheder understøtter JUNOS også DHCP server funktionen. Den konfigureres under [ system services dhcp ] stanza'en. Konfigurationen f...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

DHCP Server

Som så mange andre netværks enheder understøtter JUNOS også DHCP server funktionen. Den konfigureres under [ system services dhcp ] stanza'en. Konfigurationen finder selv sammen med adresserne der er konfigureret på et interface.

[edit system services dhcp]
rael@SRX240# <input>show</input>
pool 10.0.255.0/24 {
    address-range low 10.0.255.10 high 10.0.255.250;
    name-server {
        172.16.4.77;
    }
    router {
        10.0.255.1;
    }
    propagate-settings vlan.99;
}

her er konfigureret et pool med range, DNS og Router settings. Ud over de definerede options arver den automatisk options fra vlan.99 interfacet, der er konfigureret til DHCP Klient.
Options kan både ligge i scopet eller globalt på serveren.

Show kommandoer

[edit system services dhcp]
rael@SRX240# <input>run show system services dhcp binding</input>
IP address       Hardware address   Type     Lease expires at
10.0.255.10      00:0c:29:8b:0a:49  dynamic  2015-01-12 14:13:57 UTC
10.0.0.2         84:b5:9c:2d:c5:c0  dynamic  2015-01-12 14:55:29 UTC

[edit system services dhcp]
rael@SRX240# <input>run show system services dhcp statistics</input>
Packets dropped:
    Total                      0

Messages received:
    BOOTREQUEST                0
    DHCPDECLINE                0
    <notice>DHCPDISCOVER               2</notice>
    DHCPINFORM                 0
    DHCPRELEASE                0
    <notice>DHCPREQUEST                2</notice>

Messages sent:
    BOOTREPLY                  0
    DHCPOFFER                  2
    DHCPACK                    2
    DHCPNAK                    0

[edit system services dhcp]
rael@SRX240# <source lang=cli>run show system services dhcp pool

Pool name Low address High address Excluded addresses 10.0.0.0/30 10.0.0.1 10.0.0.2 10.0.0.1 10.0.0.4/30 10.0.0.5 10.0.0.6 10.0.0.5 10.0.0.8/30 10.0.0.9 10.0.0.10 10.0.0.9 10.0.0.12/30 10.0.0.13 10.0.0.14 10.0.0.13 10.0.0.16/30 10.0.0.17 10.0.0.18 10.0.0.17 10.0.0.20/30 10.0.0.21 10.0.0.22 10.0.0.21 10.0.0.24/30 10.0.0.25 10.0.0.26 10.0.0.25 <notice>10.0.255.0/24 10.0.255.10 10.0.255.250</notice>

</source> Husk at protokollen selvfølgelig skal tillades i zonen hvis der arbejdes i flow-based

DHCP Client

Her er RVI interfacet vlan.99 konfigureret til DHCP client.

[edit]
rael@SRX240# <input>show interfaces vlan.99</input>
family inet {
    dhcp;
}
[edit]
rael@SRX240# show security zones
security-zone untrust {
    screen untrust-screen;
    interfaces {
        <notice>vlan.99</notice> {
            host-inbound-traffic {
                system-services {
                    <notice>dhcp;</notice>
                    tftp;
                }
            }
        }
    }
}

DHCP Relay

Mangler

Referencer