virtualbox_nic_router: two routers, all dynamic

Two nested NIC routers between virtualbox and the NIC driver.
Both routers are DHCP clients at the uplink and DHCP servers at the
downlink.

Ref #2534
This commit is contained in:
Martin Stein 2017-10-16 12:49:03 +02:00 committed by Christian Helmuth
parent 9d84d8b3bd
commit 42b1eefe73
1 changed files with 35 additions and 6 deletions

View File

@ -94,14 +94,15 @@ append_if [expr $use_net] config {
<provides><service name="Nic"/></provides>
</start>
<start name="nic_router" caps="200">
<start name="router1" caps="200">
<binary name="nic_router"/>
<resource name="RAM" quantum="10M"/>
<provides><service name="Nic"/></provides>
<config rtt_sec="6" verbose="yes">
<policy label_prefix="vbox1" domain="vbox"/>
<policy label_prefix="router2" domain="router2"/>
<domain name="vbox" interface="10.0.1.79/24">
<domain name="router2" interface="10.0.1.79/24">
<dhcp-server ip_first="10.0.1.80"
ip_last="10.0.1.100"
ip_lease_time_sec="20"
@ -110,8 +111,8 @@ append_if [expr $use_net] config {
<udp dst="0.0.0.0/0"><permit-any domain="uplink"/></udp>
</domain>
<domain name="uplink" interface="10.0.0.72/24" gateway="10.0.0.1">
<nat domain="vbox" tcp-ports="999" udp-ports="999"/>
<domain name="uplink">
<nat domain="router2" tcp-ports="999" udp-ports="999"/>
</domain>
</config>
@ -120,6 +121,34 @@ append_if [expr $use_net] config {
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="router2" caps="200">
<binary name="nic_router"/>
<resource name="RAM" quantum="10M"/>
<provides><service name="Nic"/></provides>
<config rtt_sec="6" verbose="yes">
<policy label_prefix="vbox1" domain="vbox"/>
<domain name="vbox" interface="10.0.2.79/24">
<dhcp-server ip_first="10.0.2.80"
ip_last="10.0.2.100"
ip_lease_time_sec="20"
dns_server="10.0.0.2"/>
<tcp dst="0.0.0.0/0"><permit-any domain="uplink"/></tcp>
<udp dst="0.0.0.0/0"><permit-any domain="uplink"/></udp>
</domain>
<domain name="uplink">
<nat domain="vbox" tcp-ports="999" udp-ports="999"/>
</domain>
</config>
<route>
<service name="Nic"> <child name="router1"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
}
append_if [expr $use_serial] config {
@ -151,7 +180,7 @@ append config {
</vfs>
</config>
<route>
<service name="Nic"> <child name="nic_router"/> </service>
<service name="Nic"> <child name="router2"/> </service>
<any-service> <parent /> <any-child /> </any-service>
</route>
</start>