hi, 抱歉我沒看清楚, swconfig 只是 logical port number 而已 實際上不一定是按照我們所見的順序對照 interface 所以我自己是ㄧ個一個 port 測試的, watch ip link |grep up -i 不知道其他人有沒有比較好的方式 謝謝 Ping-Chun Huang 黃秉鈞 pichuang http://blog.night9.cc Wireless Internet Laboratory Computer Center, Department of Computer Science National Chiao Tung University 2015-05-28 23:41 GMT+08:00 林清祥 <woni...@gmail.com
>: > Hi, > > 我现在的问题在于如何把LAN Port 1~4与ifconfig -a打印的interface对应起来。 > 比如: > Lan port 1 --> eth0 > Lan port 2 --> eth1 > 可 现在的Lan port 与 interface 好像不一一对应。 > > 在 2015年5月28日星期四 UTC+8下午11:25:09,Ping Chun Huang写道: >> >> hi, >> >> =>我现在的问题是如何修改/etc/config/network,使得LAN Port >> 1可以与Floodlight所在的机器正常通信,而LAN Port 2~4和“无线端口”提供给OVS作为对外端口。 >> >> 利用 out-of-band 的設計方式, 不要把 lan port 1 add-port 進 ovs, 且另外指定 ip 跟 >> floodlight做溝通, 記得 routing table 要改好 >> >> 謝謝 >> >> >> 2015-05-28 11:09 GMT+08:00 林清祥 <woni...@gmail.com>: >> > 大家好, >> > >> > 我已经在HiWiFi j1s(http://www.hiwifi.com/j1s-para)上编译Open >> > vSwitch,确定在预设的网络设定下, >> > OVS可以通过LAN口连接Floodlight。 >> > >> > 我现在的问题是如何修改/etc/config/network,使得LAN Port 1可以与Floodlight所在的机器正常通信,而LAN >> > Port >> > 2~4和“无线端口”提供给OVS作为对外端口。 >> > >> > 刚接触Openwrt,所以我对Openwrt上ifconfig -a输出的interface如何对应到物理端口(WAN port 和 LAN >> > port >> > 1~4)也不是很了解。 >> > >> > 能否请大家抽空帮忙指导一下,谢谢! >> > >> > Openwrt的预设配置/etc/config/network >> > >> > config interface 'loopback' >> > option ifname 'lo' >> > option proto 'static' >> > option ipaddr '127.0.0.1' >> > option netmask '255.0.0.0' >> > >> > config globals 'globals' >> > option ula_prefix 'fdea:fa5f:ba69::/48' >> > >> > config interface 'lan' >> > option ifname 'eth0.1' >> > option force_link '1' >> > option macaddr '00:0c:43:76:20:a0' >> > option type 'bridge' >> > option proto 'static' >> > option ipaddr '192.168.1.1' >> > option netmask '255.255.255.0' >> > option ip6assign '60' >> > >> > config interface 'wan' >> > option ifname 'eth0.2' >> > option force_link '1' >> > option macaddr '00:0c:43:76:20:a1' >> > option proto 'dhcp' >> > >> > config interface 'wan6' >> > option ifname 'eth0.2' >> > option proto 'dhcpv6 >> > >> > 通过命令行 swconfig dev mt7620 show列印出的输出: >> > root@HiWiFi:~# swconfig dev mt7620 show >> > Global attributes: >> > enable_vlan: 1 >> > Port 0: >> > pvid: 2 >> > link: port:0 link:up speed:100baseT full-duplex >> > Port 1: >> > pvid: 1 >> > link: port:1 link:up speed:10baseT half-duplex >> > Port 2: >> > pvid: 1 >> > link: port:2 link:down >> > Port 3: >> > pvid: 1 >> > link: port:3 link:down >> > Port 4: >> > pvid: 1 >> > link: port:4 link:up speed:10baseT half-duplex >> > Port 5: >> > pvid: 1 >> > link: port:5 link:down >> > Port 6: >> > pvid: 1 >> > link: port:6 link:up speed:1000baseT full-duplex >> > Port 7: >> > pvid: 0 >> > link: port:7 link:down >> > VLAN 1: >> > vid: 1 >> > ports: 1 2 3 4 5 6t >> > VLAN 2: >> > vid: 2 >> > ports: 0 6t >> > >> > ifconfig -a >> > >> > br-lan Link encap:Ethernet HWaddr 00:0C:43:76:20:A0 >> > inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0 >> > inet6 addr: fe80::20c:43ff:fe76:20a0/64 Scope:Link >> > inet6 addr: fdea:fa5f:ba69::1/60 Scope:Global >> > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 >> > RX packets:25641 errors:0 dropped:0 overruns:0 frame:0 >> > TX packets:25370 errors:0 dropped:0 overruns:0 carrier:0 >> > collisions:0 txqueuelen:0 >> > RX bytes:2991000 (2.8 MiB) TX bytes:6501566 (6.2 MiB) >> > >> > eth0 Link encap:Ethernet HWaddr 00:0C:43:76:20:A0 >> > inet6 addr: fe80::20c:43ff:fe76:20a0/64 Scope:Link >> > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 >> > RX packets:795250 errors:0 dropped:71 overruns:0 frame:0 >> > TX packets:24836 errors:0 dropped:0 overruns:0 carrier:0 >> > collisions:0 txqueuelen:1000 >> > RX bytes:139689640 (133.2 MiB) TX bytes:6594763 (6.2 MiB) >> > Interrupt:5 >> > >> > eth0.1 Link encap:Ethernet HWaddr 00:0C:43:76:20:A0 >> > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 >> > RX packets:28720 errors:0 dropped:0 overruns:0 frame:0 >> > TX packets:23467 errors:0 dropped:0 overruns:0 carrier:0 >> > collisions:0 txqueuelen:0 >> > RX bytes:3560626 (3.3 MiB) TX bytes:6318988 (6.0 MiB) >> > >> > eth0.2 Link encap:Ethernet HWaddr 00:xC:43:xx:20:A1 >> > inet addr:xxx.xx.xxx.xxx Bcast:xxx.xxx.xxx.255 >> > Mask:255.255.255.0 >> > inet6 addr: 2xx1:xxx:6xx3:2xx4:20c:xxxx:xxx:xxx/64 >> > Scope:Global >> > inet6 addr: xxxx::xxx:xxxx:xxxx:xxxx/64 Scope:Link >> > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 >> > RX packets:765882 errors:0 dropped:92 overruns:0 frame:0 >> > TX packets:1099 errors:0 dropped:0 overruns:0 carrier:0 >> > collisions:0 txqueuelen:0 >> > RX bytes:121709573 (116.0 MiB) TX bytes:149388 (145.8 KiB) >> > >> > gre0 Link encap:UNSPEC HWaddr >> > 00-00-00-00-00-00-50-E8-00-00-00-00-00-00-00-00 >> > NOARP MTU:1476 Metric:1 >> > RX packets:0 errors:0 dropped:0 overruns:0 frame:0 >> > TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 >> > collisions:0 txqueuelen:0 >> > RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) >> > >> > gretap0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 >> > BROADCAST MULTICAST MTU:1462 Metric:1 >> > RX packets:0 errors:0 dropped:0 overruns:0 frame:0 >> > TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 >> > collisions:0 txqueuelen:1000 >> > RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) >> > >> > lo Link encap:Local Loopback >> > inet addr:127.0.0.1 Mask:255.0.0.0 >> > inet6 addr: ::1/128 Scope:Host >> > UP LOOPBACK RUNNING MTU:65536 Metric:1 >> > RX packets:188 errors:0 dropped:0 overruns:0 frame:0 >> > TX packets:188 errors:0 dropped:0 overruns:0 carrier:0 >> > collisions:0 txqueuelen:0 >> > RX bytes:16168 (15.7 KiB) TX bytes:16168 (15.7 KiB) >> > >> > wlan0 Link encap:Ethernet HWaddr 00:0C:43:76:20:A0 >> > inet6 addr: fe80::20c:43ff:fe76:20a0/64 Scope:Link >> > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 >> > RX packets:0 errors:0 dropped:0 overruns:0 frame:0 >> > TX packets:3944 errors:0 dropped:0 overruns:0 carrier:0 >> > collisions:0 txqueuelen:1000 >> > RX bytes:0 (0.0 B) TX bytes:715296 (698.5 KiB) >> > ------------------ >> > —— >> > Thanks. >> > >> > Best Regards, >> > >> > LIN Qingxiang(林清祥) >> > ------ >> > Graduate >> > College of Mathematics and Computer Science, FZU >> > >> > >> > -- >> > Welcome to http://sdnds.tw/
。 > 如要在網路上查看這項討論,請造訪 > https://groups.google.com/d/msgid/sdnds-tw/1d1d2a42-c7b7-448b-96d4-b7ad7cd21997%40googlegroups.com。 > 如需更多選項,請前往:https://groups.google.com/d/optout。
ovs-vsctl add-br br0
ovs-vsctl add-port br0 eth0.1
ovs-vsctl add-port br0 eth0.2
ovs-vsctl add-port br0 eth0.3
ovs-vsctl add-port br0 eth0.4
config interface 'wan'
option ifname 'eth0.0'
option force_link '1'
option macaddr '00:0c:43:76:20:a1'
option proto 'dhcp'
config interface 'lan1'
option ifname 'eth0.1'
option proto 'static'
config interface 'lan2'
option ifname 'eth0.2'
option proto 'static'
config interface 'lan3'
option ifname 'eth0.3'
option proto 'static'
config interface 'lan4'
option ifname 'eth0.4'
option proto 'static'
config interface 'lan4'
option ifname 'eth0.4'
option proto 'static'
config switch
option name switch0
option reset 1
option emable_vlan 1
config switch_vlan
option device switch0
option vlan '0'
option ports '0 6t'
config switch_vlan
option device switch0
option vlan '1'
option ports '1 6t'
config switch_vlan
option device switch0
option vlan '2'
option ports '2 6t'
config switch_vlan
option device switch0
option vlan '3'
option ports '3 6t'
config switch_vlan
option device switch0
option vlan '4'
option ports '4 6t'