Solaris10运维笔记

软件包下载地址:http://mirror.opencsw.org/opencsw/testing/i386/5.10

网卡配置
一.激活网卡
问题:VMware9安装solaris 10后,用ifconfig -a只能看到一个lo0,说明只有一个本地环回,即网卡没有启动或者系统没有识别到

bash-3.2# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
       inet 127.0.0.1 netmask ff000000
 bash-3.2# dladm show-dev
e1000g0        link: unknown   speed: 0    Mbps      duplex: unknown

说明己识别,只是没有激活,使用以下命令激活:

bash-3.2# ifconfig e1000g0 plumb
bash-3.2# dladm show-dev
e1000g0        link: up       speed: 1000 Mbps      duplex: full
bash-3.2# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
       inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000842 mtu 1500 index 2
       inet 0.0.0.0 netmask 0
       ether 0:c:29:24:74:cc

若还出现问题,可以修改VMware虚拟机的配置文件
you will probably get the error failed to plumb pcn0
If so follow these steps, if not, and everything magically works..cool
AFTER INSTALL
--------------------
for networking.
--------------------
shutdown the VM
edit the .VMX file in the virtual machine folder on the host OS and add the following line
ethernet0.virtualDev = "e1000"
then startup Solaris
-----------------------------------------------

二.设置IP
DHCP:
ifconfig e1000g0 dhcp  
静态IP:
ifconfig e1000g0 192.168.1.2 netmask 255.255.255.0 up  #只是当前会话生效而已,要想重启后仍生效则需要修改配置文件。

最基本的网络配置主要为配置网卡的:ip,gateway,netmasks及defaultrouter
如:在安装solaris的时候,在网络配置选择是选择了dhcp服务,但是我现在想要配置静态的ip及hostname等等
/etc/hosts                          #hostname及对应的ip ,是/etc/inet/hosts的软连接
/etc/hostname.e1000g0    #对应网卡的主机名(网卡名称可以通过ifconfig -a查看)
/etc/netmasks                     #子网掩码,是/etc/inet/netmask的软连接           
/etc/defaultrouter               #默认网关
/etc/nodename                 #节点名(或主机名)
/etc/networks                   #network and broadcast,是/etc/inet/networks的软连接

在solaris中只要设置过dhcp,则会优先于静态ip

首先到etc目录,查看一下有没有dhcp目录及dhcp.e1000g0文件,如果有说明启动了dhcp服务,若要配置静态ip需要将其删除,或是改名
 mv /etc/dhcp.e1000g0{,.bak}
要更改的配置为:
hostname:jlive
ip:192.168.1.2
netmask:255.255.255.0
defaultrouter:192.168.1.11.修改/etc/nodename文件,这个文件默认不存在,需要自己建立,内容为xtts
echo  xtts >/etc/nodename
2.修改/etc/hosts文件,

#
# Internet host table
#
::1    localhost      loghost xtts
127.0.0.1      localhost      loghost xtts


3.修改/etc/defaultrouter,默认不存在,需要自己建立
echo  192.168.1.1 >/etc/defaultrouter
4.修改/etc/hostname.e1000g0,若没有,需要自己建立
echo  192.168.1.2 >/etc/hostname.e1000g0
5.修改/etc/netmasks
192.168.1.0   255.255.255.0
6.修改/etc/networks

# The loopback network is used only for intra-machine communication
#
loopback       127

#
# Internet networks
#
arpanet        10             arpa    # Historical

-----------------------------------------------
7.重启网络
svcadm restart network/physical

配置dns:

cd /etc
cp nsswitch.conf nsswitch.conf.bak        #nsswitch.conf中有配置本机的访问外部的主机名时,ip采用何种解析策略.
cp nsswitch.dns nsswitch.conf            #默认的nsswitch.conf中采用根据hosts文件来解析的策略.而nsswitch.dns则设置了解析使用hosts文件和dns来解析.
vi resolv.conf
nameserver 192.168.235.1
nameserver 8.8.8.8
nameserver 8.8.4.4

设置ssh远程登陆

配置/etc/ssh/sshd_config的PermitRootLogin参数

PermitRootLogin yes

重启SSH服务,使配置生效

# svcadm restart ssh

Solaris10下关闭防火墙

# svcs -a |grep network |egrep "pfil|ipf"

enable         Oct_22   svc:/network/ipfilter:default
online          Oct_22    svc:/network/pfil:default

#svcadm disable  svc:/network/ipfilter:default

使用TAB键自动补全

修改配置 /etc/passwd

vi /etc/passwd
将root:x:0:0:Super-User:/:/sbin/sh改为
 root:x:0:0:Super-User:/:/bin/bash

显示当前用户与目录

修改配置文件/etc/profile
export PS1='[\u@\h:$PWD]#'
source /etc/profile

Solaris 下自动安装依赖软件的工具pkgutil

1. 从http://mirror.opencsw.org/opencsw/pkgutil.pkg 下载安装好pkgutil

pkgadd -d pkgutil.pkg all

2. 把 /opt/csw/bin添加到path目录下。
/opt/csw/bin/pkgutil
3. 自动安装vim和所依赖的包。

pkgutil -y -i vim
-y, --yes             Answer yes on all prompts
-i, --install         Install package
-a, --available       Show available packages

4. 查询仓库中的安装包

[root@xtts:/]#pkgutil -a subversion
common               package              catalog                        size
ap2_subversion       CSWap2-subversion    1.9.4,REV=2016.09.20        99.4 KB
ap2_subversion_stub  CSWap2svn            1.9.4,REV=2016.09.20         7.3 KB
pm_subversion        CSWpm-subversion     1.9.4,REV=2016.09.20         2.2 MB
pm_subversion_stub   CSWpmsvn             1.9.4,REV=2016.09.20         7.3 KB
py_subversion        CSWpy-subversion     1.9.4,REV=2016.09.20       844.4 KB
rb_subversion        CSWrb-subversion     1.9.4,REV=2016.09.20       726.9 KB
subversion           CSWsubversion        1.9.4,REV=2016.09.20         1.3 MB
subversion_contrib   CSWsvn-contrib       1.7.5,REV=2012.05.27         5.8 KB
subversion_dev       CSWsubversion-dev    1.9.4,REV=2016.09.20       344.6 KB
subversion_stub      CSWsvn               1.9.4,REV=2016.09.20         7.3 KB
subversion_tools     CSWsvn-tools         1.7.5,REV=2012.05.27         5.8 KB

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值