From 4b919a56642ccd0a44920feace872aeb5b7a62cf Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Sat, 11 Mar 2017 05:55:21 -0800 Subject: Attached hosts allow this config to function: set int ip address loop0 169.254.1.1/32 (the default GW address for attached hosts) set int unnumbered af_packet0 use loop0 ('enable' IP on the host interface) ip route add 192.168.1.1/32 via af_packet0 (where to find the host) repeat for each host and host interface. Inter-host communication is throught the /32 routes. To allow this: 1 - attached host routes have the ATTACHED flag set, so the ARP code accepts then as legitimate sources 2 - unnumbered interfaces inherit the source address from the IP interface Change-Id: Ib66c5f0e848c528f79372813adc3a0c11b50717f Signed-off-by: Neale Ranns --- src/vnet/interface_cli.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/vnet/interface_cli.c') diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c index bd715e4ea4b..ec8530da299 100644 --- a/src/vnet/interface_cli.c +++ b/src/vnet/interface_cli.c @@ -864,6 +864,10 @@ set_unnumbered (vlib_main_t * vm, si->unnumbered_sw_if_index = (u32) ~ 0; ip4_sw_interface_enable_disable (unnumbered_sw_if_index, 0); ip6_sw_interface_enable_disable (unnumbered_sw_if_index, 0); + ip4_main.lookup_main.if_address_pool_index_by_sw_if_index + [unnumbered_sw_if_index] = ~0; + ip6_main.lookup_main.if_address_pool_index_by_sw_if_index + [unnumbered_sw_if_index] = ~0; } else if (is_set) { @@ -871,6 +875,14 @@ set_unnumbered (vlib_main_t * vm, si->unnumbered_sw_if_index = inherit_from_sw_if_index; ip4_sw_interface_enable_disable (unnumbered_sw_if_index, 1); ip6_sw_interface_enable_disable (unnumbered_sw_if_index, 1); + ip4_main.lookup_main.if_address_pool_index_by_sw_if_index + [unnumbered_sw_if_index] = + ip4_main.lookup_main.if_address_pool_index_by_sw_if_index + [inherit_from_sw_if_index]; + ip6_main.lookup_main.if_address_pool_index_by_sw_if_index + [unnumbered_sw_if_index] = + ip6_main.lookup_main.if_address_pool_index_by_sw_if_index + [inherit_from_sw_if_index]; } return 0; -- cgit 1.2.3-korg