:~# netadm list
TYPE PROFILE STATE
ncp Automatic online
ncu:phys net0 online
ncu:phys net1 online
ncu:phys net3 online
ncu:phys net2 online
ncu:ip net0 online
ncu:ip net1 online
ncu:ip net3 online
ncu:ip net2 online
ncp DefaultFixed disabled
loc DefaultFixed offline
loc Automatic online
loc NoNet offline
Showing the phyiscal interface
root@unixrock:~# dladm show-phys LINK MEDIA STATE SPEED DUPLEX DEVICE net0 Ethernet up 1000 full e1000g0 net1 Ethernet up 1000 full e1000g1 net3 Ethernet up 1000 full e1000g3 net2 Ethernet up 1000 full e1000g2 root@unixrock:~#
Showing the Link status of the physical interface
root@unixrock:~# dladm show-link LINK CLASS MTU STATE OVER net0 phys 1500 up -- net1 phys 1500 up -- net3 phys 1500 up -- net2 phys 1500 up -- root@unixrock:~#
checking existing interface on the system
root@unixrock:~# ipadm show-if IFNAME CLASS STATE ACTIVE OVER lo0 loopback ok yes -- net0 ip ok yes -- net1 ip ok yes -- net2 ip ok yes -- net3 ip ok yes -- root@unixrock:~#
checking MAC address and IP address
root@unixrock:~# ipadm show-addr ADDROBJ TYPE STATE ADDR lo0/v4 static ok 127.0.0.1/8 net0/v4 dhcp ok 192.168.113.139/24 net1/v4 dhcp ok 192.168.113.141/24 net2/v4 dhcp ok 192.168.113.143/24 net3/v4 dhcp ok 192.168.113.142/24 lo0/v6 static ok ::1/128 net0/v6 addrconf ok fe80::20c:29ff:febf:ac5b/10 net1/v6 addrconf ok fe80::20c:29ff:febf:ac65/10 net2/v6 addrconf ok fe80::20c:29ff:febf:ac6f/10 net3/v6 addrconf ok fe80::20c:29ff:febf:ac79/10 root@unixrock:~#
root@unixrock:~# dladm show-phys
LINK MEDIA STATE SPEED DUPLEX DEVICE
net0 Ethernet UNKNOWN 1000 full e1000g0
net1 Ethernet UNKNOWN 1000 full e1000g1
net3 Ethernet UNKNOWN 1000 full e1000g3
net2 Ethernet UNKNOWN 1000 full e1000g2
root@unixrock:~#
root@unixrock:~# dladm show-link
LINK CLASS MTU STATE OVER
net0 phys 1500 UNKNOWN --
net1 phys 1500 UNKNOWN --
net3 phys 1500 UNKNOWN --
net2 phys 1500 UNKNOWN --
root@unixrock:~#
root@unixrock:~# ipadm show-if
IFNAME CLASS STATE ACTIVE OVER
lo0 loopback ok yes --
root@unixrock:~#
root@unixrock:~# ipadm show-addr
Asssing IP Address to the net0 interface
root@unixrock:~# ipadm create-addr -T static -a 192.168.113.139/24 net0/v4test root@unixrock:~# root@unixrock:~# ipadm show-if IFNAME CLASS STATE ACTIVE OVER lo0 loopback ok yes -- net0 ip ok yes -- root@unixrock:~# ipadm show-addr ADDROBJ TYPE STATE ADDR lo0/v4 static ok 127.0.0.1/8) net0/v4test static ok 192.168.113.139/24 lo0/v6 static ok ::1/128 root@unixrock:~#
NOTE : "T" - option can be used for three specify interface mode static, DHCP and addrconf (auto configured IPV6 address) Trying DHCP for another interface net1
root@unixrock:~# root@unixrock:~# ipadm create-ip net1 root@unixrock:~# ipadm create-addr -T dhcp net1/v4test2 root@unixrock:~# ipadm show-if IFNAME CLASS STATE ACTIVE OVER lo0 loopback ok yes -- net0 ip ok yes -- net1 ip ok yes -- root@unixrock:~# ipadm show-addr ADDROBJ TYPE STATE ADDR lo0/v4 static ok 127.0.0.1/8 net0/v4test static ok 192.168.113.139/24 net1/v4test2 dhcp ok 192.168.113.141/24 lo0/v6 static ok ::1/128 root@unixrock:~#
If you want to change the IP, then we need to delete and recreate the interface with new IP. Let we change the IP address
root@unixrock:~# ipadm delete-ip net2 root@unixrock:~# ipadm create-ip net2 root@unixrock:~# ipadm create-addr -T static -a 192.168.113.140 net2/v4test1 root@unixrock:~# ipadm show-addr ADDROBJ TYPE STATE ADDR lo0/v4 static ok 127.0.0.1/8 net0/v4test static ok 192.168.113.139/24 net1/v4test2 dhcp ok 192.168.113.141/24 net2/v4test1 static ok 192.168.113.140/24 lo0/v6 static ok ::1/128 root@unixrock:~#
No comments:
Post a Comment