• 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 mount the zfs rpool while booted from CD [SPARC]
  2. Understanding Special Permissions (setuid, setgid, sticky bit) in Solaris
  3. How to save sar reports longer than 7 days in Solaris
  4. Solaris Interview Questions – Inodes and the Filesystem Troubleshooting
  5. Solaris (SPARC) : How to create OBP boot device alias at ok prompt
  6. How to delegate NTP service to non-global zone in Solaris
  7. How To Use ‘zpool split’ to Split rpool in solaris 11 (x86/x64)
  8. Solaris 11 IPS pkg Command Examples
  9. How to find Number of Physical/Logical CPUs, cores and memory in Solaris
  10. Beginners Guide to Solaris 11 Image Packaging System (IPS)

You May Also Like

Primary Sidebar

Recent Posts

  • ctags: Generates an index (or tag) file of language objects found in source files for many popular programming languages
  • csvtool: Utility to filter and extract data from CSV formatted sources
  • csvstat: Print descriptive statistics for all columns in a CSV file
  • csvsql: Generate SQL statements for a CSV file or execute those statements directly on a database

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright