欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Solaris11配置静态IP

程序员文章站 2022-04-08 21:16:51
...

Oracle Solaris11安装好默认是DHCP的,禁用DHCP。 netadm enable -p ncp DefaultFixed 设置net0(公网)、net1(私网)和网关 ipadm create-ip net0ipadm create-addr -T static -a 192.168.1.61/24 net0/v4staticroute -p add default 192.168.1.1ipadm create-

Oracle Solaris11安装好默认是DHCP的,禁用DHCP。

netadm enable -p ncp DefaultFixed 

设置net0(公网)、net1(私网)和网关

ipadm create-ip net0
ipadm create-addr -T static -a 192.168.1.61/24 net0/v4static
route -p add default 192.168.1.1
ipadm create-ip net1
ipadm create-addr -T static -a 172.168.1.61/24 net1/v4static

配置DNS

root@vzwc1:~# svccfg
svc:> select name-service/switch
svc:/system/name-service/switch> setprop config/host = astring: "files dns"
svc:/system/name-service/switch> setprop config/ipnodes = astring:  "files dns"
svc:/system/name-service/switch> select name-service/switch:default
svc:/system/name-service/switch:default> refresh
svc:/system/name-service/switch:default> validate
svc:/system/name-service/switch:default> exit
oracle@vzwc1:~/.ssh$ ifconfig -a                                                                                                                                                                                                    
lo0: flags=2001000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000 
net0: flags=1000843 mtu 1500 index 2
        inet 192.168.1.61 netmask ffffff00 broadcast 192.168.1.255
net1: flags=1000843 mtu 1500 index 3
        inet 172.168.1.61 netmask ffffff00 broadcast 172.168.1.255
lo0: flags=2002000849 mtu 8252 index 1
        inet6 ::1/128 
net0: flags=20002000840 mtu 1500 index 2
        inet6 ::/0 
net1: flags=20002000840 mtu 1500 index 3
        inet6 ::/0 
oracle@vzwc1:~/.ssh$                                                                                                                                                                                                                
oracle@vzwc1:~/.ssh$                                                                                                                                                                                                                
oracle@vzwc1:~/.ssh$ ping -s www.baidu.com                                                                                                                                                                                          
PING www.baidu.com: 56 data bytes
64 bytes from 115.239.210.26: icmp_seq=0. time=11.186 ms
64 bytes from 115.239.210.26: icmp_seq=1. time=11.315 ms
64 bytes from 115.239.210.26: icmp_seq=2. time=10.247 ms
^C
----www.baidu.com PING Statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip (ms)  min/avg/max/stddev = 10.247/10.916/11.315/0.583