Solaris 11 配置IP地址
查看ip
ipadm show-addr
删除IP地址
ipadm delete-addr net0/v4
配置IP地址
ipadm create-addr –T static –a local=10.90.2.X/24 net0/v4
网关:
临时网关
route -p add default 10.90.2.254
永久生效网关:
#vi /etc/defaultrouter 添加网关地址
10.90.2.254
测试ip已通:
root@solaris:~$ ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 net0: flags=100001000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,PHYSRUNNING> mtu 1500 index 2 inet 10.90.6.114 netmask ffffff00 broadcast 10.90.6.255 lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1 inet6 ::1/128 net0: flags=120002000840<RUNNING,MULTICAST,IPv6,PHYSRUNNING> mtu 1500 index 2 inet6 ::/0
root@solaris:~$ ping 10.90.6.93
10.90.6.93 is alive
下面是配置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
配置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
如对您有帮助,支持下呗!
微信
支付宝