Cisco as a IO control device
For some fun, i try to use my Router, for other things than routing.
And here is one thing, that i have build and tested.
If this is usefull or not for other peaples, i don't know, but for some of my
ideas, it works.
I testet this with my Cisco1803 and IOS Version 12.4(4)T3
My IO-Cable is connected to Fastethernet Port 8
First You have to build a special cable. We need to short-out the PIN's 1 and 3 and port 2 and 6 from the RJ45
the best way is, to use al old cable and connect a switch between the Pin's
cable layout
And now, we need to configure the Port.
The best way is, to fix the Speed with (speed 100) and do "NOT" use Auto-Negotiation on the port (duplex full)!
interface fasterhernet 8
duplex full
speed 100
no shutdown
First here is a sample, to create some Syslog Entries with Event-Manager
event manager applet PORT8UP
event syslog pattern "Line protocol on Interface FastEthernet8, changed state to up"
action 1.0 syslog msg "PORT 8 UP"
event manager applet PORT8DOWN
event syslog pattern "Line protocol on Interface FastEthernet8, changed state to down"
action 1.0 syslog msg "PORT 8 DOWN"
and here is the Sylog output
May 30 21:22:14.291: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down
May 30 21:22:14.295: %HA_EM-6-LOG: PORT8DOWN: PORT 8 DOWN
or in this sample: reconfigure the router and send syslog message
track 100 interface FastEthernet8 line-protocol
!
track 101 interface FastEthernet8 line-protocol
!
event manager applet UP
event track 100 state up
action 1.0 cli command "enable"
action 1.1 cli command "configure terminal"
action 1.2 cli command "hostname evil-up"
action 1.3 cli command "exit"
action 2.0 syslog msg "PORT 8 UP + Hostname Change"
!
event manager applet DOWN
event track 101 state down
action 1.0 cli command "enable"
action 1.1 cli command "configure terminal"
action 1.2 cli command "hostname evil-down"
action 1.3 cli command "exit"
action 2.0 syslog msg "PORT 8 Down + Hostname Change"
and here is the Sylog output
May 30 21:52:47.611: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet8, changed state to up
May 30 21:53:02.391: %SYS-5-CONFIG_I: Configured from console by on vty13
May 30 21:53:02.403: %HA_EM-6-LOG: DOWN: PORT 8 Down + Hostname Change
May 30 21:53:02.931: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet8, changed state to down
May 30 21:53:02.931: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down
May 30 21:53:03.931: %LINK-3-UPDOWN: Interface FastEthernet8, changed state to down