I would like to use DDWRT in my board as Router development. My board uses Power PC (AMCC chip).
I got the RTL8366rb version 0.2.0 at (http://projects.qi-hardware.com/index.php/p/qi-kernel/source/tree/master/drivers/net/phy/rtl8366rb.c). I modified a bit source code for MDIO read & write.
I also add a section code to active PHY feature. Code as below: (If I didn't add this code at reset function, I can not ping to this interface. Ex: eth0)
Code:
static int rtl8366rb_force_link(struct switch_dev *dev, int port, int speed, int duplex)
{
u32 macData;
u32 regBits;
u32 regAddr;
u32 regData;
int link = 1, txPause = 1, rxPause = 1;
/* 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);
return 0;
}
After adding this section, I can config as steps below (RTL8366RB has 5 ports.)
WAN: port 0
LAN: port 1, 2, 3, 5.
Code:
Add virtual VLAN:
#vconfig add eth0 1
#vconfig add eth0 2
Config switch:
#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.
Forward IP:
#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. Results:
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 ?