One of the simplest route forwarding:
h1 <-> s1 <-> h2
My json file is as follows:
{
"hosts": {
"h1": {"ip": "10.0.1.1/24", "mac": "08:00:00:00:01:11",
"commands":["route add default gw 10.0.1.10 dev eth0",
"arp -i eth0 -s 10.0.1.10 08:00:00:00:01:00"]},
"h2": {"ip": "10.0.1.2/24", "mac": "08:00:00:00:01:22",
"commands":["route add default gw 10.0.1.10 dev eth0",
"arp -i eth0 -s 10.0.1.10 08:00:00:00:01:00"]}
},
"switches": {
"s1": { "cli_input" : "s1-commands.txt" }
},
"links": [
["h1", "s1-p1"], ["h2", "s1-p2"]
]
}
My txt file is as follows:
table_add ipv4_lpm ipv4_forward 10.0.1.1/32 => 08:00:00:00:01:11 1
table_add ipv4_lpm ipv4_forward 10.0.1.2/32 => 08:00:00:00:01:22 2
My code is copied from tutorials/basic/solution.
And now h1 and h2 cannot establish a connection
I went to do a packet capture analysis on h1’s network port and found that it was the arp protocol that was not responding. But the default route is configured in h1, why is it not taking effect? Do I need to do any setting?