歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Unix知識 >> Unix基礎知識

Solaris 11如何配置靜態IP

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<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1

inet 127.0.0.1 netmask ff000000

net0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

inet 192.168.1.61 netmask ffffff00 broadcast 192.168.1.255

net1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3

inet 172.168.1.61 netmask ffffff00 broadcast 172.168.1.255

lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1

inet6 ::1/128

net0: flags=20002000840<RUNNING,MULTICAST,IPv6> mtu 1500 index 2

inet6 ::/0

net1: flags=20002000840<RUNNING,MULTICAST,IPv6> 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

查看本欄目更多精彩內容:http://www.bianceng.cn/OS/unix/

Copyright © Linux教程網 All Rights Reserved