**当我们的solaris zone ip和物理(宿主)机不在同一网段,这时就需要配置下VLAN
1、确定正在系统上使用的接口的类型。
[root@cass05]#dladm show-link
e1000g0 type: non-vlan mtu: 1500 device: e1000g0
e1000g1 type: non-vlan mtu: 1500 device: e1000g1
e1000g2 type: non-vlan mtu: 1500 device: e1000g2
e1000g3 type: non-vlan mtu: 1500 device: e1000g3
例 ,若要将 e1000g0 和 e1000g1 接口配置为 VLAN 125 的一部分,则创建以下 PPA:
e1000g + 125 * 1000 + 0= e1000g125000
e1000g + 125 * 1000 + 1= e1000g125001
2、将接口配置为 VLAN 的一部分。
[root@cass05]#dladm show-link
e1000g0 type: non-vlan mtu: 1500 device: e1000g0
e1000g1 type: non-vlan mtu: 1500 device: e1000g1
e1000g2 type: non-vlan mtu: 1500 device: e1000g2
e1000g3 type: non-vlan mtu: 1500 device: e1000g3
clprivnet0 type: legacy mtu: 1500 device: clprivnet0
clprivnet1 type: legacy mtu: 1500 device: clprivnet1
clprivnet2 type: legacy mtu: 1500 device: clprivnet2
clprivnet3 type: legacy mtu: 1500 device: clprivnet3
[root@cass05]#ifconfig e1000g125001 plumb
[root@cass05]#ifconfig e1000g125000 plumb
[root@cass05]# dladm show-link
e1000g0 type: non-vlan mtu: 1500 device: e1000g0
e1000g125000 type: vlan 125 mtu: 1500 device: e1000g0
e1000g1 type: non-vlan mtu: 1500 device: e1000g1
e1000g125001 type: vlan 125 mtu: 1500 device: e1000g1
e1000g2 type: non-vlan mtu: 1500 device: e1000g2
e1000g3 type: non-vlan mtu: 1500 device: e1000g3
clprivnet0 type: legacy mtu: 1500 device: clprivnet0
clprivnet1 type: legacy mtu: 1500 device: clprivnet1
clprivnet2 type: legacy mtu: 1500 device: clprivnet2
clprivnet3 type: legacy mtu: 1500 device: clprivnet3
3、配置zone的IP地址:
[root@cass05]#zonecfg -z test10 info
zonename: test10
zonepath: /test10/ROOT
brand: native
autoboot: false
bootargs:
pool:
limitpriv:
scheduling-class:
ip-type: shared
hostid:
net:
address: 10.128.25.81
physical: e1000g125000
defrouter: 10.128.25.254
capped-memory:
physical: 4G
[swap: 8G]
[locked: 4G]
… …
4、重启zone.
[root@cass05]#zoneadm -z test10 reboot
5、登入到zone
[root@cass05]#zlogin test10
bash-3.2# ifconfig -a
lo0:2: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g125000:1: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 9
inet 10.128.25.81 netmask ffffff00 broadcast 10.128.25.255
bash-3.2# netstat -nr
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
default 10.128.25.254 UG 1 0 e1000g125000
10.128.25.0 10.128.25.81 U 1 20 e1000g125000:1
224.0.0.0 10.128.25.81 U 1 0 e1000g125000:1
127.0.0.1 127.0.0.1 UH 4 54 lo0:2
命令参考:
#netstat -rn //查看路由
#traceroute 10.128.25.254
#snoop -r -d e1000g0 icmp