12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7From now on, the parent interface (in this case, fxp0) is the trunk port, and you caninitialize and configure more VLAN interfaces and assign them to the trunk interface.Once you finish the VLAN port configuration, the trunk port (parent interface)accepts the 802.1q frames and forwards the frames to the appropriate VLANinterface based on the VLAN tag number from frame header. On the other side,every packet that is transmitted via VLAN interface, will encapsulate in the 802.1qframe and divert it to the parent interface for transmission on the wire.If you want to change the interface binding of a VLAN interface from one physicalinterface to another, you should remove the binding from the first interface manuallyusing ifconfig's -vlandev option. Then assign it to another interface with thevlandev option.# ifconfig vlan0 –vlandevThe above command will disassociate vlan0 interface from its parent interface. Andto re-assign VLAN port to another interface, you should go through the same processthat you did while configuring the VLAN interface:# ifconfig vlan0 vlan 10 vlandev bge1If you do not need the VLAN interface anymore, you can completely remove theinterface using the ifconfig's destroy option:# ifconfig vlan0 destoryTo initialize the VLAN interfaces and assign them to physical interfaces duringsystem boot time, you should add appropriate configurations to the /etc/rc.conffile. To create VLAN interfaces, the following lines should be added:cloned_interfaces="vlan0 vlan1 vlan2"ifconfig_vlan0="inet 10.0.2.1/24 vlan 10 vlandev fxp0"ifconfig_vlan1="inet 192.168.3.1/24 vlan 20 vlandev fxp0"ifconfig_vlan2="inet 172.16.0.1/24 vlan 30 vlandev fxp0"ifconfig_fxp0="up"The first line tells the system to create three virtual interfaces called vlan0, vlan1,and vlan2. The next three lines configure the VLAN pseudo-interface, assign IPaddress to each interface, as well as define VLAN tag number and parent interface(trunk port). The last line in the configuration brings the trunk port up manually.Advanced ifconfig OptionsThe Ifconfig utility has a few options to fine tune some advanced setting onnetwork interfaces.[ 113 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!