/* Set register value */
rtl8366rb_read (dev, RTL8368S_MAC_FORCE_CTRL_REG, ®Data);
regData = regData | (1<<port);
rtl8366rb_write (dev, RTL8368S_MAC_FORCE_CTRL_REG, regData);
After adding this section, I can config as steps below (RTL8366RB has 5 ports.)
WAN: port 0
LAN: port 1, 2, 3, 5.
Add virtual VLAN:
#vconfig add eth0 1
#vconfig add eth0 2
#swconfig dev rtl8366rb set reset 1
#swconfig dev rtl8366rb set enable_vlan 1
#swconfig dev rtl8366rb vlan 1 set ports "1 2 3 4 5t"
#swconfig dev rtl8366rb vlan 2 set ports "0 5t"
#udhcpc -i eth1.2 -> The board can get the IP dynamic.
#dnsmasq --conf-file=/tmp/dnsmasq.conf --user=root -> The board can assign IP to another device plug in LAN ports. (In our case: I plug-in my Laptop to test.
#echo "1" > /proc/sys/net/ipv4/ip_forward
#iptables -t nat -A POSTROUTING -o eth1.2 -j MASQUERADE
->> I can ping from my Laptop to Internet (google.com, yahoo.com, ...)
Ping testing is OK. But another protocols & applications such as wget, ssh, web browser ... it can not load.
- ssh to local server: login, logout are ok. But vi some files or use ll command to list all file, the terminal will hang. I use the Wireshark to dump the packet, it seem lost packets.
- web browser: open some text pages is OK. All most pages is loading forever.
Could you give a idea to fix it or anyone have meet it please help.
2.1 I can config my Router as Switch. Set & enable VLAN... Everything is OK.
2.2 Config 1 port as WAN, other ports as LAN. I can ping from me PC to internet (google, yahoo, ...)
Then problem I met:
When config as 2.2, I do some testing from my PC as diagram above:
- Ping local LAN network or web pages (google, yahoo, ..) is OK.
- ssh: I can login, logout, but terminal is hang when use ll or vi, ... commands.
- Open web pages by browser: The page loading forever & nothing showing.
All the commands are used to testing as the previous my post (pls refer)
So could you help to give a idea to solve those problems ?