• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to configure additional IP address on the same interface in solaris zones

by admin

Question : Can I configure additional IP addresses on the same interface in non-global zone? If yes, how?

Answer :
Yes, you can add additional IP addresses on the existing interface configured in the non global zone. In fact the procedure remains the same. To add a secondary shared interface to configured shared ip zone you would use the zonecfg command. Below is an example of adding a second interface in a zone named zone01 that will be persistent upon reboots. In this example, the Interface in the Global Zone is bge0. Additional interface in the configured zone will be bge0:2 and it will be persistent upon reboots.

1. Login into the global zone as root and proceed as follows:

global_zone # zonecfg -z zone01 
zonecfg:zone01 > info                   <---- info shows how the zone is configured now
zonename: zone01 
zonepath: /zones/zone01 
brand: native
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
inherit-pkg-dir:
  dir: /lib
inherit-pkg-dir:
  dir: /platform
inherit-pkg-dir:
  dir: /sbin
inherit-pkg-dir:
  dir: /usr
net:
  address: 10.10.2.3/24
  physical: bge0
  defrouter not specified

Next we add the second interface:

zonecfg:zone01 > add net
zonecfg:zone01 :net> set physical=bge0
zonecfg:zone01 :net> set address=10.10.2.4
zonecfg:zone01 :net> end
zonecfg:zone01 > verify
zonecfg:zone01 > commit
zonecfg:zone01 > info        <------- info again will show you the new interface you just added
zonename: zone01 
zonepath: /zones/zone01 
brand: native
autoboot: true
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
inherit-pkg-dir:
  dir: /lib
inherit-pkg-dir:
  dir: /platform
inherit-pkg-dir:
  dir: /sbin
inherit-pkg-dir:
  dir: /usr
net:
  address: 10.10.2.3/24
  physical: bge0
  defrouter not specified
net:
  address: 10.10.2.4
  physical: bge0
  defrouter not specified
zonecfg:zone01 > exit

Then we reboot the the zone zone01 :

globa_zone # zoneadm -z zone01  reboot

Now login into the zone after the reboot and run ifconfig to see the new interface:

# ifconfig -a
lo0:1: flags=2001000849 mtu 8232 index 1
  inet 127.0.0.1 netmask ff000000
bge0:1: flags=1000843 mtu 1500 index 2
  inet 10.10.2.3 netmask ffffff00 broadcast 10.10.2.255
bge0:2: flags=1000843 mtu 1500 index 2
  inet 10.10.2.4 netmask ffffff00 broadcast 10.10.2.255

In the global zone we see the new interface added to the bge interface as bge0:2

global_zone # ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
  inet 127.0.0.1 netmask ff000000
lo0:1: flags=2001000849 mtu 8232 index 1
  zone zone01 
  inet 127.0.0.1 netmask ff000000
bge0: flags=1000843 mtu 1500 index 2
  inet 10.152.24.44 netmask ffffff00 broadcast 10.152.24.255
  ether 0:3:ba:e4:7f:b0
bge0:1: flags=1000843 mtu 1500 index 2
  zone zone01 
  inet 10.10.2.3 netmask ffffff00 broadcast 10.10.2.255
bge0:2: flags=1000843 mtu 1500 index 2
  zone zone02 
  inet 10.10.2.4 netmask ffffff00 broadcast 10.10.2.255

This is all you need to do to add the interface. You do not need to do anything in the global zone and it will remain after any reboot.

Filed Under: Solaris, Zones

Some more articles you might also be interested in …

  1. How to Configure Link Aggregation in Solaris 11 (Trunk V/s Datalink multipathing (DLMP))
  2. How to run savecore (crash dump) manually in Solaris
  3. Solaris ZFS : How to import 2 pools that have the same names
  4. Solaris : How to increase the Inodes on UFS file system with newfs command
  5. Solaris Snoop : 15 Awesome practical examples for packet sniffing
  6. Understanding the sysconfig utility in Solaris 11
  7. Resource management in solaris zones : CPU shares, capped CPU, Dedicated CPU assignment
  8. Performing Network Diagnostics in Solaris 11 with “network-monitor”
  9. How to configure Solaris 10 Probe based IPMP
  10. How To Use ‘zpool split’ to Split rpool in solaris 11 (SPARC)

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright