This page contains a list of common tasks and the corresponding Tcl code snippets.
Note there are also a number of extended examples as well, which show how specific scenario configurations can be constructed using this API.
To quickly set a MAC address, you can use the following one liner:
The inner part of this statement sets the layer 2 protocol to EthII. It immediatly returns the created Layer2.EthernetII object. On this object the Mac is then set to the value of choice.
The MAC string can be entered in a variety of formats: uppercase or lowercase and seperated by dashed (-), colons (:) or nothing.
In addition to the short examples listed on this page, this documentation provides some extended examples. These examples describe how specific test configurations (e.g. udp, tcp, multicast, ...) are structured.
They have a tutorial-like approach and provide a good introduction to how the Tcl API can (and should!) be used in some specific situation.
See Extended Examples for a list of such extended examples.