Showing posts with label Common Exec. Show all posts
Showing posts with label Common Exec. Show all posts

Thursday, January 29, 2015

Camel Exec IP Aliasing | Apache Camel Exec - Execute IP Aliasing Commands


IP Aliasing


IP aliasing is associating more than one IP address to a network interface. With this, one node on a network can have multiple connections to a network, each serving a different purpose. [1]

On Linux, if you want to enable IP aliasing for an interface, you can execute a command like:
ifconfig eth0:1.1.4.21 1.1.4.21 netmask 255.255.255.0
On the other hand, if you want to disable IP aliasing, you can execute a command like:
ifconfig eth0:1.1.4.21 down


Apache Exec


The Apache Exec component can be used to execute system commands. [2]

To enable IP aliasing, run exec with URL like:
exec://sh?args=-c+%22ifconfig+eth2%3A1.1.3.21+1.1.3.21+netmask+255.255.255.0%22&timeout=60000
And to disable it, use the following URL:
exec://sh?args=-c+%22ifconfig+eth2%3A1.1.4.21+down%22&timeout=60000
If alias was already set and you want to enable it again, or the alias is disabled and you want to disable it again, you'll get some error message, like
Cannot assign requested address

References


  1. Wikipedia, http://en.wikipedia.org/wiki/IP_aliasing
  2. Apache Camel, http://camel.apache.org/exec.html



Create a Successful Online Store at Bigcommerce! Try it Free Now!