如果 Oracle 指令不起作用,该如何配置 DHCP?

如果 Oracle 指令不起作用,该如何配置 DHCP?

我正在尝试在 Solaris 11 计算机上启用 DHCP。我的 DHCP 服务器是 m0n0wall,它提供除本地广播地址(m0n0wall 中的限制)之外的所有网络配置信息。

对于我的安装,DNS/名称解析失败。DHCP 似乎配置不正确,因为 DHCP 提供了以下信息:

qotom-solaris11:~$ ping www.google.com
ping: getaddrinfo: temporary name resolution failure
ping: unknown host www.google.com

我多次按照 Oracle 的指示重置机器,发现如何启用 DHCP 客户端。该过程使用sysconfig configure并设置网络堆栈、添加 root 密码、添加用户、设置时区等。它基本上是机器重置。

如果 Oracle 指令不起作用,我该如何启用 DHCP?

相关的是,重置整个机器似乎有点极端。为什么 Oracle 会告诉人们重置整个机器?


编辑

$ sudo ifconfig net0
net0: flags=100001004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4,PHYSRUNNING> mtu 1500 index 2
        inet 172.16.4.21 netmask ffff0000 broadcast 172.16.255.255
        ether 52:54:0:4:42:a3 

和:

$ sudo netstat -rn

Routing Table: IPv4
  Destination           Gateway           Flags  Ref     Use     Interface 
-------------------- -------------------- ----- ----- ---------- --------- 
default              172.16.1.1           UG        1          0 net0      
127.0.0.1            127.0.0.1            UH        3        998 lo0       
172.16.0.0           172.16.4.21          U         3        385 net0      

Routing Table: IPv6
  Destination/Mask            Gateway                   Flags Ref   Use    If   
--------------------------- --------------------------- ----- --- ------- ----- 
::1                         ::1                         UH      2     686 lo0   
fe80::/10                   fe80::5054:ff:fe04:42a3     U       2       0 net0 

和:

$ sudo cat /etc/resolv.conf

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#   DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See resolv.conf(4) for details.

domain  home.pvt

以下是来自同一子网中运行的观察者机器dhcpdump。它捕获了 DHCP 服务器和 Solaris 主机之间的流量:

$ sudo dhcpdump -i eth0
  TIME: 2016-08-25 21:14:32.717
    IP: 0.0.0.0 (52:54:0:4:42:a3) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: ef048b4a
  SECS: 0
 FLAGS: 0
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: 52:54:00:04:42:a3:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         3 (DHCPREQUEST)
OPTION:  50 (  4) Request IP address        172.16.4.21
OPTION:  51 (  4) IP address leasetime      -1 ()
OPTION:  57 (  2) Maximum DHCP message size 1472
OPTION:  60 ( 10) Vendor class identifier   SUNW.i86pc
OPTION:  55 (  6) Parameter Request List      1 (Subnet mask)
                          3 (Routers)
                         12 (Host name)
                         15 (Domainname)
                         28 (Broadcast address)
                         43 (Vendor specific info)

这是一些dmesg信息。它可能(或可能不)相关。

qotom-solaris11:~$ dmesg | egrep -i '(dhcp|error)'
Aug 25 20:07:45 qotom-solaris11 /sbin/dhcpagent[372]: [ID 778557 daemon.warning] configure_v4_lease: no IP broadcast specified for net0, making best guess
Aug 25 20:08:05 qotom-solaris11 auditd[522]: [ID 956865 daemon.error] getaddrinfo(qotom-solaris11) failed[temporary name resolution failure].
Aug 25 20:08:05 qotom-solaris11 auditd[721]: [ID 956865 daemon.error] getaddrinfo(qotom-solaris11) failed[temporary name resolution failure].
Aug 25 20:08:06 qotom-solaris11 auditd[522]: [ID 956865 daemon.error] getaddrinfo(qotom-solaris11) failed[temporary name resolution failure].
Aug 25 20:08:06 qotom-solaris11 auditd[721]: [ID 956865 daemon.error] getaddrinfo(qotom-solaris11) failed[temporary name resolution failure].
Aug 25 20:08:07 qotom-solaris11 auditd[522]: [ID 956865 daemon.error] getaddrinfo(qotom-solaris11) failed[temporary name resolution failure].
Aug 25 20:08:07 qotom-solaris11 auditd[721]: [ID 956865 daemon.error] getaddrinfo(qotom-solaris11) failed[temporary name resolution failure].
Aug 25 20:08:08 qotom-solaris11 auditd[522]: [ID 994446 daemon.error] mapping qotom-solaris11 to fe80::5054:ff:fe04:42a3.
Aug 25 20:08:08 qotom-solaris11 auditd[721]: [ID 994446 daemon.error] mapping qotom-solaris11 to fe80::5054:ff:fe04:42a3.
Aug 25 20:15:16 qotom-solaris11 rpcbind: [ID 564983 daemon.error] rpcbind terminating on signal.
Aug 25 20:17:20 qotom-solaris11 /sbin/dhcpagent[372]: [ID 778557 daemon.warning] configure_v4_lease: no IP broadcast specified for net0, making best guess

答案1

Solaris DHCP 客户机故障排除,他们详细说明了这一过程:

 # pkill -x dhcpagent
 # /sbin/dhcpagent -d1 -f &
 # ifconfig net0 dhcp start 

答案2

它似乎/etc/default/dhcpagent已损坏。我猜它是在我们家里遇到的众多电源问题之一中损坏的。有价值的小玩意儿有电涌保护,但大多数没有主动 UPS。Solaris 测试机不是重点,所以它没有 UPS。

/etc/default/dhcpagent从正常运行的 Solaris 11 测试机复制并重新启动解决了该问题(如下所示)。Oracle 一直告诉我要执行的重置操作太多了...

$ cat /etc/default/dhcpagent
#
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
#

#
# This file contains tunable parameters for dhcpagent(1M).
#

# All parameters can be tuned for a specific interface by prepending
# the interface name to the parameter name.  For example, to make
# VERIFIED_LEASE_ONLY happen on all interfaces except hme0, specify:
#
# hme0.VERIFIED_LEASE_ONLY=no
# VERIFIED_LEASE_ONLY=yes
#
# An interface name alone specifies IPv4 DHCP.  For DHCPv6, append ".v6".
# Some examples:
#
# hme0.VERIFIED_LEASE_ONLY=no           specify hme0 v4 behavior
# hme0.v6.VERIFIED_LEASE_ONLY=no        specify hme0 v6 behavior
# VERIFIED_LEASE_ONLY=no                match all v4 interfaces
# .v6.VERIFIED_LEASE_ONLY=no            match all v6 interfaces

# By default, when the DHCP agent is sent a SIGTERM (typically when
# the system is shut down), all managed addresses are dropped rather
# than released.  Dropping an address does not notify the DHCP server
# that the address is no longer in use, leaving it possibly available
# for subsequent use by the same client.  If DHCP is later restarted
# on the interface, the client will ask the server if it can continue
# to use the address.  If the server either grants the request, or
# does not answer (and the lease has not yet expired), then the client
# will use the original address.
#
# Similarly, when the system is suspended and then woken up or when
# the link status transitions from down to up, DHCP will ask the server
# to continue to use the managed address, in case the lease has changed.
#
# By uncommenting the following parameter-value pairs, all managed
# addresses are released on SIGTERM instead, and any that may have been
# saved but cannot be verified will not be used.  When SIGTERM is
# received, the DHCP server is notified that the address is available
# for use, and the address will not be saved for a later restart.  If
# DHCP receives SIGTHAW or a link-up event, DHCP will attempt to verify
# the previous lease, but if unable to do so, it will not attempt to
# use that lease.  This behavior is often preferred for roaming systems.
#
# VERIFIED_LEASE_ONLY=yes
# .v6.VERIFIED_LEASE_ONLY=yes

# By default, the DHCP agent waits 3 seconds to collect OFFER
# responses to a DISCOVER.  If it receives no OFFERs in this time, it
# then waits for another 3 seconds, and so forth.  To change this
# behavior, set and uncomment the following parameter-value pair.
# Note: this does not control the retransmission strategy for
# DISCOVERs, which is formally specified in RFC 2131.  This parameter
# is specified in seconds.
#
# OFFER_WAIT=

# By default, the DHCP agent does not send out a client identifier
# (and hence, the chaddr field is used by the DHCP server as the
# client identifier.)  To make the DHCP agent send a client
# identifier, set and uncomment the following parameter-value pair.
# Note that by default this is treated as an NVT ASCII string.  To
# specify a binary value, prepend "0x" to a sequence of hexadecimal
# digits (for example, the value 0xAABBCC11 would set the client
# identifier to the 4-byte binary sequence 0xAA 0xBB 0xCC 0x11).
#
# CLIENT_ID=

# By default, a parameter request list requesting a subnet mask (1),
# router (3), DNS server (6), hostname (12), DNS domain (15), broadcast
# address (28), and encapsulated vendor options (43), is sent to the DHCP
# server when the DHCP agent sends requests.  However, if desired, this
# can be changed by altering the following parameter-value pair.  The
# numbers correspond to the values defined in the IANA bootp-dhcp-parameters
# registry at the time of this writing.  Site and standard option names from
# /etc/dhcp/inittab are also accepted.
#
PARAM_REQUEST_LIST=1,3,6,12,15,28,43

# The default DHCPv6 parameter request list has preference (7), unicast (12),
# DNS addresses (23), DNS search list (24), NIS addresses (27), and
# NIS domain (29).  This may be changed by altering the following parameter-
# value pair.  The numbers correspond to the values defined in the IANA
# dhcpv6-parameters registry at the time of this writing.  Site and standard
# option names from /etc/dhcp/inittab6 are also accepted.
.v6.PARAM_REQUEST_LIST=7,12,23,24,27,29

# The parameter ignore list allows you to instruct the DHCP client to discard
# optional parameters received from the DHCP server.  The format is the same
# as the request list above.  When discarded, a parameter will not be acted
# on by the DHCP client or returned to users via the dhcpinfo(1) command.
PARAM_IGNORE_LIST=
.v6.PARAM_IGNORE_LIST=

相关内容