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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. Beginners guide to Oracle Solaris Live Upgrade
  2. How to install a ZFS boot block in solaris
  3. The ultimate Solaris Volume Manager (SVM) interview questions
  4. How to configure passwordless ssh in Solaris
  5. How to find Number of Physical/Logical CPUs, cores and memory in Solaris
  6. How to Configure Link Aggregation in Solaris 11 (Trunk V/s Datalink multipathing (DLMP))
  7. Solaris : How to unconfigure and configure a cpu/memory board using cfgadm
  8. Solaris : How to configure a user account to never expire (disable password aging)
  9. How to enable XDMCP in GNOME Display Manager (gdm) for Solaris 10,11
  10. How to add Additional Storage Space Created from Dynamic LUN Expansion in SVM online

You May Also Like

Primary Sidebar

Recent Posts

  • Failed to start LSB: Bring up/down networking – On restarting network service CentOS/RHEL (DHCP client)
  • How To Add Timestamps To dmesg Kernel Boot Log in CentOS/RHEL
  • How to disable ICMP redirects on CentOS/RHEL
  • What are Oracle Key Vault Roles
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary