Closed shashibici closed 9 years ago
I figured out the solution.
The reason why I cannot get the ClickOS use the second networking interface is that I didn't configure the ClickOS well.
Take the firewall.click example (http://cnp.neclab.eu/getting-started#example-configurations) as the baseline, the users can access any networking interfaces on the guest VM by modifying the argument passed to FromDevice() and ToDevice().
The DEVID is counted from 0 by default, which means, in the above case, the second networking interface should be counted as "1". In order to refer to the second networking interface, I use FromDevice(1) and ToDevice(1). By default, FromDevice() and ToDevice() are referred as the first networking interface on the VM.
An example: click.xen:
# I am trying to connect the two virtual NICs to xenbr0 and xenbr1 respectively
vif = ['mac=00:15:17:15:5d:74,bridge=xenbr0', 'mac=00:15:17:15:5d:80,bridge=xenbr1']
In the .click file, I can refre the two virtual NICs in this way:
// NIC with 00:15:17:15:5d:74 as MAC address, connecting to xenbr0
FromDevice(0);
// NIC with 00:15:17:15:5d:80 as MAC address, connecting to xenbr1
ToDevice(1);
See:
http://xenbits.xen.org/docs/4.4-testing/misc/xl-network-configuration.html
for more details in xl network configuration.
Great. I'll close this then.
Best -- Filipe
Hi,
I am now trying to configure ClickOS as a firewall, in which case I would like to set two NICs on one ClickOS vm.
More specifically, I would like to bind two NICs to two different bridges in Xen Dom0, say, xenbr0 and xenbr1. Then I expect that packets sent from xenbr0 could be received by xenbr1.
In order to implement this, I modified the xen configuration file for ClickOS. The modified xen configuration file is listed as below:
click.xen
kernel = './minios/build/clickos_x86_64' vcpus = '1'
cpus = '2'
memory = '120' vif = ['mac=00:15:17:15:5d:74,bridge=xenbr0', 'mac=00:15:17:15:5d:80,bridge=xenbr1'] name = 'click0' on_crash = 'preserve'
Output of cosmos console
Xen Minimal OS! start_info: 0x1f9000(VA) nr_pages: 0x7800 shared_inf: 0xbfc72000(MA) pt_base: 0x1fc000(VA) nr_pt_frames: 0x5 mfn_list: 0x1bd000(VA) mod_start: 0x0(VA) mod_len: 0 flags: 0x0 cmd_line: stack: 0x17a040-0x19a040 MM: Init _text: 0x0(VA) _etext: 0xe2e86(VA) _erodata: 0x160000(VA) _edata: 0x161bb8(VA) stack start: 0x17a040(VA) _end: 0x1bc010(VA) start_pfn: 204 max_pfn: 7800 Mapping memory range 0x400000 - 0x7800000 setting 0x0-0x160000 readonly skipped 0x1000 MM: Initialise page allocator for 23e000(23e000)-7800000(7800000) MM: done Demand map pfns at 7801000-2007801000. Heap resides at 2007802000-4007802000. Initialising timer interface Initialising console ... done. gnttab_table mapped at 0x7801000. Initialising scheduler Thread "Idle": pointer: 0x2007802050, stack: 0x250000 Thread "xenstore": pointer: 0x2007802800, stack: 0x260000 xenbus initialised on irq 1 mfn 0x45b71 Thread "shutdown": pointer: 0x2007802fb0, stack: 0x270000 Dummy main: start_info=0x19a040 Thread "main": pointer: 0x2007803760, stack: 0x280000 sparsing 0MB at 179000 "main" [on_status:205] router id 0 [on_status:206] status change to Running Thread "click": pointer: 0x2007810c60, stack: 0x2a0000 Failed to read /local/domain/0/backend/vif/1/0/feature-netmap. ****** NETFRONT for device/vif/0
net TX ring size 256 net RX ring size 256 backend at /local/domain/0/backend/vif/1/0 mac is 00:15:17:15:5d:74
[router_thread:157] Starting driver...
[app_shutdown:365] Requested shutdown reason=poweroff [router_stop:172] Stopping all routers...
[router_stop:179] Stopping instance = 0...
[router_thread:160] Stopping driver...
close network: backend at /local/domain/0/backend/vif/1/0 [router_thread:164] Master/driver stopped, closing router_thread Thread "click" exited. [router_stop:186] Stopped all routers...
[main:350] Shutting down... close(0) close(1) close(2) main returned 0 MiniOS will shutdown (reason = poweroff) ...
After ClickOS is running, I send packets from xenbr0. ClickOS receives. I send packets from xenbr1, and ClickOS does not receive.
To make sure xenbr1 is correctly configured, I modified the vif in this way:
Then I run ClickOS again. It receives packets sent from xenbr1, and it is not able to receive packets sent from xenbr0.
It seems that ClickOS could not use the second networking interface.
Should I need to configure the Xen or to configure the ClickOS to make the second mac address available?
Many thanks.
--Hongda.