user1175570
user1175570

Reputation: 27

Creating graphviz tree graph - one to one mapping

Trying to create a network graph (host-> open_port -> service). When I graph below sample, I end up with a (many_host -> one_port -> many_services).

How can I isolate this where i have a graph showing each open port on each host with the individual service on that port? something like:

"10.0.0.1": 
    "25" -> "smtp" -> "sendmail version_x"
    "53" -> "domain" -> "dnsmasq"
    "443" -> "https" -> "Apache 1.3"

"10.0.0.2"  
    "25" -> "smtp" -> "postfix version_x"

"10.0.0.3" 
    "25" -> "smtp" -> "sendmail version_y"
    "53" -> "domain" -> "dnsmasq"
    "443" -> "https" -> "Apache 2.0"

"10.0.0.4" 
    "25" -> "smtp" -> "sendmail version_y"

--sample-------

digraph "map"{
rankdir=LR

subgraph cluster0{
"10.0.0.1" -> "25" -> "smtp" -> "sendmail version_x"
"10.0.0.1" -> "53" -> "domain" -> "dnsmasq 2.45 "
"10.0.0.1" -> "443" -> "https" -> "Apache 1.3"
}
subgraph cluster1{
"10.0.0.2" -> "25" -> "smtp" -> "postfix version_x"

subgraph cluster2{
"10.0.0.3" -> "25" -> "smtp" -> "sendmail version_y"
"10.0.0.3" -> "53" -> "domain" -> "dnsmasq 2.45 "
"10.0.0.3" -> "443" -> "https" -> "Apache 2.0"
}
subgraph cluster3{
"10.0.0.4" -> "25" -> "smtp" -> "sendmail version_y"

Upvotes: 0

Views: 339

Answers (1)

dgw
dgw

Reputation: 13646

Just prepend the ports/services/etc. with the IP and set the label to the port number

"10.0.0.3:25" [label="25"] ;
"10.0.0.3.smtp" [label="smtp"] ;
"10.0.0.3" -> "10.0.0.3:25" -> "10.0.0.3.smtp" ...

Upvotes: 1

Related Questions