zoukankan      html  css  js  c++  java
  • NetScaler通过DHCP服务器获取IP地址

    NetScaler通过DHCP服务器获取IP地址

    DHCP 选项参考 https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

    参考链接:https://docs.citrix.com/en-us/netscaler-hardware-platforms/mpx/netscaler-initial-configuration.html

    Linux DHCP 服务搭建:

    [root@lsgxeva ~]# yum install -y dhcp.x86_64  dhcp-devel.x86_64
    [root@lsgxeva ~]# cd /etc/dhcp/
    [root@lsgxeva ~]# cp -rf  /usr/share/doc/dhcp-4.2.5/* .
    [root@lsgxeva ~]# cat dhcpd.conf.example > dhcpd.conf
    [root@lsgxeva ~]# cat dhcpd6.conf.example > dhcpd6.conf
    [root@lsgxeva ~]# 
    [root@lsgxeva ~]# vi dhcpd.conf
    [root@lsgxeva ~]# cat dhcpd.conf
    # dhcpd.conf
    #
    # Sample configuration file for ISC dhcpd
    #
    
    # option definitions common to all supported networks...
    option domain-name "domain.org";
    option domain-name-servers 192.168.185.191;
    
    default-lease-time 600;
    max-lease-time 7200;
    
    # Use this to enble / disable dynamic dns updates globally.
    ddns-update-style none;
    
    # If this DHCP server is the official DHCP server for the local
    # network, the authoritative directive should be uncommented.
    authoritative;
    
    # Use this to send dhcp log messages to a different log file (you also
    # have to hack syslog.conf to complete the redirection).
    log-facility local7;
    
    allow client-updates;
    allow booting;
    allow bootp;
    
    option space auto;
    option auto.key code 1 = text;
    
    class "adc-device" {
    	match option vendor-class-identifier;
    }
    
    subnet 192.168.185.0 netmask 255.255.255.0 {
    	option routers 192.168.185.91;
    	option domain-name "domain.org";
    	option domain-name-servers 192.168.185.101; 
    	default-lease-time 21600;
    	max-lease-time 43200;
    
    	#
    	# vendor-option-space: 
    	#     citrix-NS
    	#
    	subclass "adc-device" "citrix-NS" {
    		vendor-option-space auto;
    		option auto.key "citrix-NS";
    	}
    
    	pool {
    		allow members of "adc-device";
    		range 192.168.185.11 192.168.185.19;
    		option subnet-mask 255.255.255.0;
    	}
    }
    
    # No service will be given on this subnet, but declaring it helps the 
    # DHCP server to understand the network topology.
    
    #subnet 10.152.187.0 netmask 255.255.255.0 {
    #}
    
    # This is a very basic subnet declaration.
    
    #subnet 10.254.239.0 netmask 255.255.255.224 {
    #  range 10.254.239.10 10.254.239.20;
    #  option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
    #}
    
    # This declaration allows BOOTP clients to get dynamic addresses,
    # which we don't really recommend.
    
    #subnet 10.254.239.32 netmask 255.255.255.224 {
    #  range dynamic-bootp 10.254.239.40 10.254.239.60;
    #  option broadcast-address 10.254.239.31;
    #  option routers rtr-239-32-1.example.org;
    #}
    
    # A slightly different configuration for an internal subnet.
    #subnet 10.5.5.0 netmask 255.255.255.224 {
    #  range 10.5.5.26 10.5.5.30;
    #  option domain-name-servers ns1.internal.example.org;
    #  option domain-name "internal.example.org";
    #  option routers 10.5.5.1;
    #  option broadcast-address 10.5.5.31;
    #  default-lease-time 600;
    #  max-lease-time 7200;
    #}
    
    # Hosts which require special configuration options can be listed in
    # host statements.   If no address is specified, the address will be
    # allocated dynamically (if possible), but the host-specific information
    # will still come from the host declaration.
    
    #host passacaglia {
    #  hardware ethernet 0:0:c0:5d:bd:95;
    #  filename "vmunix.passacaglia";
    #  server-name "toccata.fugue.com";
    #}
    
    # Fixed IP addresses can also be specified for hosts.   These addresses
    # should not also be listed as being available for dynamic assignment.
    # Hosts for which fixed IP addresses have been specified can boot using
    # BOOTP or DHCP.   Hosts for which no fixed address is specified can only
    # be booted with DHCP, unless there is an address range on the subnet
    # to which a BOOTP client is connected which has the dynamic-bootp flag
    # set.
    #host fantasia {
    #  hardware ethernet 08:00:07:26:c0:a5;
    #  fixed-address fantasia.fugue.com;
    #}
    
    # You can declare a class of clients and then do address allocation
    # based on that.   The example below shows a case where all clients
    # in a certain class get addresses on the 10.17.224/24 subnet, and all
    # other clients get addresses on the 10.0.29/24 subnet.
    
    #class "foo" {
    #  match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
    #}
    
    #shared-network 224-29 {
    #  subnet 10.17.224.0 netmask 255.255.255.0 {
    #    option routers rtr-224.example.org;
    #  }
    #  subnet 10.0.29.0 netmask 255.255.255.0 {
    #    option routers rtr-29.example.org;
    #  }
    #  pool {
    #    allow members of "foo";
    #    range 10.17.224.10 10.17.224.250;
    #  }
    #  pool {
    #    deny members of "foo";
    #    range 10.0.29.10 10.0.29.230;
    #  }
    #}
    
    [root@lsgxeva ~]# 
    [root@lsgxeva ~]# vi /etc/sysconfig/dhcpd
    [root@lsgxeva ~]# cat /etc/sysconfig/dhcpd
    # WARNING: This file is NOT used anymore.
    
    # If you are here to restrict what interfaces should dhcpd listen on,
    # be aware that dhcpd listens *only* on interfaces for which it finds subnet
    # declaration in dhcpd.conf. It means that explicitly enumerating interfaces
    # also on command line should not be required in most cases.
    
    # If you still insist on adding some command line options,
    # copy dhcpd.service from /lib/systemd/system to /etc/systemd/system and modify
    # it there.
    # https://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
    
    # example:
    # $ cp /usr/lib/systemd/system/dhcpd.service /etc/systemd/system/
    # $ vi /etc/systemd/system/dhcpd.service
    # $ ExecStart=/usr/sbin/dhcpd -f -cf /etc/dhcp/dhcpd.conf -user dhcpd -group dhcpd --no-pid <your_interface_name(s)>
    # $ systemctl --system daemon-reload
    # $ systemctl restart dhcpd.service
    
    #
    #指定网络接口名称,在eth0 网络接口上启用dhcp 服务。
    DHCPDARGS="eno67109408"
    
    [root@lsgxeva ~]# 
    [root@lsgxeva ~]# systemctl start dhcpd.service
    [root@lsgxeva ~]# systemctl status dhcpd.service
    [root@lsgxeva ~]# systemctl enable dhcpd.service
  • 相关阅读:
    Java包装类
    Java锁机制ReentrantLock
    Java内部类介绍
    JAVA多线程学习六-守护线程
    JAVA多线程学习五:线程范围内共享变量&ThreadLocal
    JAVA多线程学习四
    Maven之阿里云镜像仓库配置
    JAVA多线程学习- 三:volatile关键字
    ansible学习(二)- 清单配置详解
    Java多线程学习(二)
  • 原文地址:https://www.cnblogs.com/lsgxeva/p/8646513.html
Copyright © 2011-2022 走看看