Network Configuration in solaris 11
network configuration in solaris 11 using ipadm
command
root@hari:~# dladm show-link
LINK CLASS MTU STATE OVER
net0 phys 1500 up --
net1 phys 1500 unknown --
net2 phys 1500 unknown --
root@hari:~#
---here I am using net1 and net2 for demo purpose:
----How to give the ip address in solaris 11 ?
1.plumb the interface
2.give the ip for the inferface
3.Add the entries into /etc /hosts file
root@hari:~# ipadm help
The following subcommands are supported:
Address : create-addr delete-addr disable-addr
down-addr enable-addr refresh-addr
reset-addrprop set-addrprop show-addr
show-addrprop up-addr
Interface : disable-if enable-if reset-ifprop
set-ifprop show-if show-ifprop
IP interface : create-ip delete-ip
IPMP interface : add-ipmp create-ipmp delete-ipmp
remove-ipmp
Protocol property : reset-prop set-prop show-prop
VNI interface : create-vni delete-vni
For more info, run: ipadm help <subcommand>
root@hari:~#
root@hari:~# ipadm create-ip net1
------It plumbs interface.
root@hari:~# dladm show-link
LINK CLASS MTU STATE OVER
net0 phys 1500 up --
net1 phys 1500 up --
net2 phys 1500 unknown --
root@hari:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
net1 ip down no --
root@hari:~#
root@hari:~# ipadm create-addr -T static -a
192.168.29.167/24 net1/v4
root@hari:~# ipadm show-addr
ADDROBJ TYPE STATE ADDR
lo0/v4 static ok 127.0.0.1/8
net0/v4 static ok 192.168.29.166/24
net1/v4 static ok 192.168.29.167/24
lo0/v6 static ok ::1/128
root@hari:~#
root@hari:~# ifconfig net1
net1:
flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 5
inet 192.168.29.167 netmask ffffff00 broadcast
192.168.29.255
ether 0:c:29:4d:db:74
root@hari:~# ping 192.168.29.167
192.168.29.167 is alive
root@hari:~#
---add the entry into /etc/hosts file as below.
root@hari:~# cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc. All rights
reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost loghost
192.168.29.166 hari
192.168.29.167 net1-ip
root@hari:~#
##################To delete the ip address in solaris
11#########
root@hari:~# ipadm delete-ip net1
---It deletes ip and unplumb the interface
root@hari:~# ipadm
NAME CLASS/TYPE STATE UNDER ADDR
lo0 loopback ok -- --
lo0/v4 static ok -- 127.0.0.1/8
lo0/v6 static ok -- ::1/128
net0 ip ok -- --
net0/v4 static ok -- 192.168.29.166/24
root@hari:~#
--comment the entry in the /etc/hosts file
root@hari:~# cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc. All rights
reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost loghost
192.168.29.166 hari
##192.168.29.167 net1-ip
root@hari:~#
------------------ipmp configuration in solaris
11____________________
steps:
1.Take 2 Nic cards and plumb both of them.
2.Give the ip addresses as below
3.Create one ipmp group
4.Add the interfaces into ipmp group
5.Give the ip address for the ipmp group
Demo:
root@hari:~# ipadm create-ip net1
root@hari:~# ipadm create-ip net2
root@hari:~# ipadm create-addr -T static -a
192.168.29.161/24 net1/v4
root@hari:~# ipadm create-addr -T static -a
192.168.29.162/24 net2/v4
root@hari:~# ipadm
NAME CLASS/TYPE STATE UNDER ADDR
lo0 loopback ok -- --
lo0/v4 static ok -- 127.0.0.1/8
lo0/v6 static ok -- ::1/128
net0 ip ok -- --
net0/v4 static ok -- 192.168.29.166/24
net1 ip ok -- --
net1/v4 static ok -- 192.168.29.161/24
net2 ip ok -- --
net2/v4 static ok -- 192.168.29.162/24
root@hari:~# ipadm create-ipmp ipmp0
root@hari:~# ipadm add-ipmp -i net1 -i net2 ipmp0
root@hari:~# ipadm create-addr -T static -a
192.168.29.163/24 ipmp0/v4
Example
>
ipadm create-ipmp -i
eth1,eth2 bondeth0
ipadm create-addr -T
static -a 202.31.182.131/24 bondeth0/v4
root@hari:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
net1 ip ok yes --
net2 ip ok yes --
ipmp0 ipmp ok yes net1 net2
root@hari:~#
Add the entry in the /etc/hosts file.
root@hari:~# cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc. All rights
reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost loghost
192.168.29.166 hari
##192.168.29.167 net1-ip
192.168.29.163 ipmp0-ip
root@hari:~# ping ipmp0-ip
ipmp0-ip is alive
root@hari:~#
---------How to delete ipmp in solaris 11-------
root@hari:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
net0 ip ok yes --
net1 ip ok yes --
net2 ip ok yes --
ipmp0 ipmp ok yes net1 net2
root@hari:~# ipadm delete-ipmp ipmp0
ipadm: cannot delete IPMP interface ipmp0: IPMP group
is not empty
댓글 없음:
댓글 쓰기