Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Oracle Solaris 11 Advanced Administration Cookbook.docx
Скачиваний:
3
Добавлен:
01.07.2025
Размер:
3 Мб
Скачать
☆

Getting ready

To follow this recipe, you must have two virtual machines (VirtualBox or VMware) with Oracle Solaris 11 installed and have 4 GB RAM and four network interfaces in the first virtual machine. The second machine can have just one network interface.

How to do it…

Let's see what we have in the system by executing the following command:

root@solaris11-1:~# 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@solaris11-1:~# ipadm show-addr| grep v4

ADDROBJ TYPE STATE ADDR

lo0/v4 static ok 127.0.0.1/8 net0/v4 dhcp ok 192.168.1.108/24 net1/v4 dhcp ok 192.168.1.106/24 net2/v4 dhcp ok 192.168.1.109/24 net3/v4 dhcp ok 192.168.1.107/24

There are four interfaces that get their IP address from a local DHCP service. Therefore, to configure the link aggregation, it's necessary to delete all IP object addresses from all interfaces and verify their status by running the following commands:

root@solaris11-1:~# ipadm delete-ip net0 root@solaris11-1:~# ipadm delete-ip net1 root@solaris11-1:~# ipadm delete-ip net2 root@solaris11-1:~# ipadm delete-ip net3 root@solaris11-1:~# ipadm show-addr | grep v4

Chapter 3

ADDROBJ TYPE STATE ADDR

lo0/v4 static ok 127.0.0.1/8 root@solaris11-1:~# ipadm show-if

IFNAME CLASS STATE ACTIVE OVER

lo0 loopback ok yes -- root@solaris11-1:~# dladm show-link

LINK CLASS MTU STATE OVER

net0 phys 1500 up --

net1 phys 1500 up --

net2 phys 1500 up --

net3 phys 1500 up --

Nice. Everything is working. This time, the link aggregation (the trunk link aggregation) can be set up. Let's take all of the interfaces to create the aggregation by running the following command:

root@solaris11-1:~# dladm create-aggr -l net0 -l net1 -l net2 -l net3 super_aggr_0

To check whether the aggregation was created, execute the following command:

root@solaris11-1:~# dladm show-link

LINK CLASS MTU STATE OVER

net0 phys 1500 up --

net1 phys 1500 up --

net2 phys 1500 up --

net3 phys 1500 up --

LINK

MODE POLICY

ADDRPOLICY

LACPACTIVITY LACPTIMER

super_aggr_0

trunk L4

auto

off short

super_aggr_0 aggr 1500 up net0 net1 net2 net3 More details about the aggregation can be gathered by executing the following command: root@solaris11-1:~# dladm show-aggr

The super_aggr_0 aggregation was created, and it works like a single network interface.

As we mentioned previously, the default aggregation type is trunk and the default policy is L4 (Communication). For curiosity, if we wanted to create a DMLP link aggregation, the command would be as follows:

root@solaris11-1:~# dladm create-aggr –m dlmp -l net0 -l net1 -l net2 -l net3 super_aggr_0

Networking

Now, it's time to create an IP object on it:

root@solaris11-1:~# ipadm create-ip super_aggr_0 root@solaris11-1:~# ipadm show-addr | grep v4 ADDROBJ TYPE STATE ADDR

lo0/v4 static ok 127.0.0.1/8

The super_aggr_0 aggregation is still down because no IP address is assigned to it:

root@solaris11-1:~# ipadm show-if

IFNAME CLASS STATE ACTIVE OVER

lo0 loopback ok yes --

super_aggr_0 ip down no --

However, everything is ok at the layer 2 level (Datalink):

root@solaris11-1:~# dladm show-link

LINK CLASS MTU STATE OVER

net0 phys 1500 up --

net1 phys 1500 up --

net2 phys 1500 up --

net3 phys 1500 up --

super_aggr_0 aggr 1500 up net0 net1 net2 net3

Great! The definitive step is to assign an IP address to the aggregation object, which is

super_aggr_0:

root@solaris11-1:~# ipadm create-addr -T static -a 192.168.1.166/24 super_aggr_0/v4

root@solaris11-1:~# ipadm show-if

IFNAME CLASS STATE ACTIVE OVER

lo0 loopback ok yes -- super_aggr_0 ip ok yes --

As we've learned previously, all interfaces are hidden and only the link aggregation interface is shown and presented to an external network. To collect more information about the aggregation, run the following command:

root@solaris11-1:~# dladm show-aggr

LINK MODE POLICY ADDRPOLICY LACPACTIVITY LACPTIMER

super_aggr_0 trunk L4 auto off short root@solaris11-1:~# ipadm show-addr | grep v4

Chapter 3

ADDROBJ

TYPE

STATE

ADDR

lo0/v4

static

ok

127.0.0.1/8

super_aggr_0/v4

static

ok

192.168.1.166/24

A recommended way to verify whether everything is working is to try to send and receive packets:

root@solaris11-1:~# ping 192.168.1.1

192.168.1.1 is alive

We can also monitor the link aggregation activity by using the netstat command:

root@solaris11-1:~# netstat -i -I super_aggr_0 -f inet

Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue

super_aggr_0 1500 192.168.1.0 192.168.1.166 32745 0 243 0

0 0

root@solaris11-1:~# netstat -rn -f inet

Routing Table: IPv4

Destination Gateway Flags Ref Use Interface

------------------ ----------------- ------ ------- ------- --------- 127.0.0.1 127.0.0.1 UH 2 8066 lo0

192.168.1.0 192.168.1.166 U 3 28 super_aggr_0

We have almost finished our learning (not yet!). To change the link aggregation policy (for example, from L4 to L2), we execute the following command:

root@solaris11-1:~# dladm show-aggr

LINK MODE POLICY ADDRPOLICY LACPACTIVITY LACPTIMER

super_aggr_0 trunk L4 auto off short root@solaris11-1:~# dladm modify-aggr --policy=L2 super_aggr_0 root@solaris11-1:~# dladm show-aggr

LINK MODE POLICY ADDRPOLICY LACPACTIVITY LACPTIMER

super_aggr_0 trunk L2 auto off short

Our example of link aggregation was created using four interfaces. However, an interface can be either inserted or removed anytime. First, we have to know which interfaces are part of the aggregation by running the following command:

root@solaris11-1:~# dladm show-link

LINK CLASS MTU STATE OVER

net0 phys 1500 up --

net1 phys 1500 up --

Networking

net2

phys

1500

up

--

net3

phys

1500

up

--

super_aggr_0

aggr

1500

up

net0 net1 net2 net3

Now, it's easy to remove an interface from aggregation by executing the following command:

root@solaris11-1:~# dladm remove-aggr -l net3 super_aggr_0

To confirm that the previous command worked, run the following command:

root@solaris11-1:~# dladm show-link

LINK CLASS MTU STATE OVER

net0 phys 1500 up --

net1 phys 1500 up --

net2 phys 1500 up --

net3 phys 1500 up --

super_aggr_0 aggr 1500 up net0 net1 net2

Adding an interface follows almost the same syntax, as follows:

root@solaris11-1:~# dladm add-aggr -l net3 super_aggr_0

root@solaris11-1:~# dladm show-link

LINK

CLASS

MTU

STATE

OVER

net0

phys

1500

up

--

net1

phys

1500

up

--

net2

phys

1500

up

--

net3

phys

1500

up

--

super_aggr_0

aggr

1500

up

net0 net1 net2

net3

root@solaris11-1:~#

Finally, we can remove the aggregation in order to prepare our environment for the next section:

root@solaris11-1:~# ipadm show-if

IFNAME CLASS STATE ACTIVE OVER

IFNAME

CLASS

STATE

ACTIVE

OVER

lo0

loopback

ok

yes

--

lo0 loopback ok yes -- super_aggr_0 ip ok yes -- root@solaris11-1:~# ipadm delete-ip super_aggr_0 root@solaris11-1:~# ipadm show-if

Chapter 3

root@solaris11-1:~# ipadm show-addr

ADDROBJ TYPE STATE ADDR

lo0/v4 static ok 127.0.0.1/8

lo0/v6 static ok ::1/128 root@solaris11-1:~# dladm show-link

LINK CLASS MTU STATE OVER

net0 phys 1500 up --

net1 phys 1500 up --

net2 phys 1500 up --

net3 phys 1500 up --

super_aggr_0 aggr 1500 up net0 net1 net2 net3 root@solaris11-1:~# dladm delete-aggr super_aggr_0

root@solaris11-1:~# dladm show-link

LINK CLASS MTU STATE OVER

net0 phys 1500 up --

net1 phys 1500 up --

net2 phys 1500 up --

net3 phys 1500 up -- root@solaris11-1:~# ipadm show-addr

ADDROBJ TYPE STATE ADDR

lo0/v4 static ok 127.0.0.1/8

lo0/v6 static ok ::1/128 root@solaris11-1:~#

root@solaris11-1:~# ipadm create-ip net0 root@solaris11-1:~# ipadm create-ip net1 root@solaris11-1:~# ipadm create-ip net2 root@solaris11-1:~# ipadm create-ip net3 root@solaris11-1:~# ipadm show-addr

ADDROBJ TYPE STATE ADDR

lo0/v4 static ok 127.0.0.1/8

lo0/v6 static ok ::1/128 root@solaris11-1:~# ipadm create-addr -T dhcp net0 net0/v4

root@solaris11-1:~# ipadm create-addr -T dhcp net1

net1/v4

root@solaris11-1:~# ipadm create-addr -T dhcp net2

Networking

net2/v4

root@solaris11-1:~# ipadm create-addr -T dhcp net3

net3/v4

root@solaris11-1:~# ipadm show-addr | grep v4

ADDROBJ TYPE STATE ADDR

lo0/v4 static ok 127.0.0.1/8 net0/v4 dhcp ok 192.168.1.108/24 net1/v4 dhcp ok 192.168.1.106/24 net2/v4 dhcp ok 192.168.1.109/24 net3/v4 dhcp ok 192.168.1.107/24 root@solaris11-1:~#

Excellent! We've completed our study of link aggregation.

An overview of the recipe

In this section, we learned about both types of link aggregation. The main advantage is the performance because it puts all interfaces together, hides them, and presents only the final logical object: the link aggregation object. For external hosts, this works as there was only a single interface on the system. Furthermore, we saw how to monitor, modify, and delete aggregations.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]