This discussion is archived
3 Replies Latest reply: Nov 11, 2012 3:14 PM by Marty RSS

Zone multiple ip addresses

973353 Newbie
Currently Being Moderated
Hello,
I am new user on Solaris and also use from 5 years FreeBSD.
At beginning I would say that very enjoy working on Solaris but I can’t jump of the problem with multiple IP address in one non-global zone.

In FreeBSD when I want set tree IP address in jail
Adding IP address to network interfaces
/sbin/ifconfig nfe1 192.168.3.3 alias
/sbin/ifconfig nfe1 192.168.3.4 alias
/sbin/ifconfig nfe1 192.168.3.5 alias

and start jail with these IP:

/usr/sbin/jail /usr/jails/testjail test.com 192.168.3.3,192.168.3.4,192.168.3.5 /bin/sh /usr/local/ssh/sbin/sshd.sh start &
But on Solaris I can’t figure out how set two ip addresses to one interface.
I tried configuring zone with IP shared but always I can set only one IP.
Thanks for any help : )
  • 1. Re: Zone multiple ip addresses
    Marty Newbie
    Currently Being Moderated
    In Solaris almost everything around the network stack has been abstracted and virtualized. Each NIC can be bonded into aggregates. Each NIC or aggregate can be splintered into any number of virtual NICs. The dladm command manages these links. Each link has various IP properties bound to it. The ipadm command manages these properties. Each zone has a network configuration profile which determines how the links are plumbed and managed. The netcfg command manages the network configuration.

    While it takes a while to wrap your head around the new network management commands, they are much easier to use than ifconfig. Start with dladm.
  • 2. Re: Zone multiple ip addresses
    973353 Newbie
    Currently Being Moderated
    Thanks for reply Marty and i solve my problem adding next net in zone.


    Example :

    zonecfg -z testzone

    add net
    set address=192.168.1.67
    set physical=net0
    end

    add net
    set address=192.168.1.67
    set physical=net0
    end

    info

    net:
    address: 192.168.1.67
    allowed-address not specified
    configure-allowed-address: true
    physical: net0
    defrouter not specified
    net:
    address: 192.168.1.68
    allowed-address not specified
    configure-allowed-address: true
    physical: net0
    defrouter not specified


    (In testzone zone)

    ifconfig -a


    lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
    inet 127.0.0.1 netmask ff000000
    net0:2: flags=1100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4> mtu 1500 index 2
    inet 192.168.1.67 netmask ffffff00 broadcast 192.168.1.255
    net0:3: flags=1100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4> mtu 1500 index 2
    inet 192.168.1.68 netmask ffffff00 broadcast 192.168.1.255
    lo0:1: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
    inet6 ::1/128


    Or second options for another proposes is create virtual switch + ipnat



    dladm create-etherstub vswitch0
    dladm create-vnic -l vswitch0 vnic0

    #info

    dladm show-vnic


    # cat /etc/ipf/ipnat.conf
    # net0 physical network card


    map net0 192.168.1.0/24 -> 0/32 portmap tcp/udp auto
    map net0 192.168.1.0/24 -> 0/32


    # start ipfilter

    svcadm enable ipfilter

    ## ipnaet check

    ipnat -l

    ## configure zone

    zonecfg -z testzone

    add net

    set address=192.168.1.67
    set physical=vnic0
    end

    Cheers.

    P.S Solaris rocks :).
  • 3. Re: Zone multiple ip addresses
    Marty Newbie
    Currently Being Moderated
    Glad you got it worked out. Yes, Solaris does rock.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points