1.从自动网络配置模式转换为手动配置模式
验证NCP
netadm list
[html] view plaincopy
netadm enable -p ncp DefaultFixed
2.确认DefaultFixed模式可用
netadm list
netadm: DefaultFixed NCP is enabled;
automatic network management is not available.
netadm list' is only supported when automatic network management is active.
3.确认要配置的接口
# dladm show-phys
4.配置net0
# ipadm create-ip net0
# ipadm create-addr -T static -a 192.168.56.200/24 net0/v4
# ipadm show-addr
5.配置网关
# route -p add default 12.34.56.1
6.配置DNS
root@solaris:~# svccfg -s dns/client
svc:/network/dns/client> setprop config/nameserver = (8.8.8.8 8.8.4.4)
svc:/network/dns/client> listprop config
config application
config/value_authorization astring solaris.smf.value.name-service.dns.client
config/nameserver net_address 8.8.8.8 8.8.4.4
svc:/network/dns/client> exit
root@solaris:~#
root@solaris:~# svcadm refresh dns/client
root@solaris:~# svcadm restart dns/client
7.配置name-server
root@solaris:~# svccfg -s name-service/switch
svc:/system/name-service/switch> setprop config/host = "files dns"
svc:/system/name-service/switch> listprop config
config application
config/default astring files
config/value_authorization astring solaris.smf.value.name-service.switch
config/printer astring "user files"
config/host astring "files dns"
svc:/system/name-service/switch> exit
8.最关键一步验证
root@solaris:~# ping google.com
google.com is alive
通过这些步骤,solaris11终于可以上网了
根据安装期间选择的网络配置模式,DefaultFixed 网络配置文件 (network configuration profile, NCP) 或 Automatic NCP 在系统中激活。如果 DefaultFixed NCP 是活动的,则通过使用 dladm 和ipadm 命令手动配置网络。