VxWorks下双网卡切换(双网冗余问题)?
在Vxworks下进行双网卡热切换,我的系统中有两块82559网卡,要实现双网卡冗余即双网卡热切换。
默认状态下,从网卡1引导启动,当从网卡1切换到网卡2时,可以ping通,但是当再从网卡2切换到网卡1时,ping不通!
首先:两块网卡的MAC地址,已经修改成相同的了!
代码如下:
#define HOST_NAME_0 ("HostName_Fei0")
#define HOST_NAME_1 ("HostName_Fei1")
#define HOST_IP ("192.168.1.222")
//---------------从网卡1切换到网卡2--------------
if(OK != hostDelete(HOST_NAME_0, HOST_IP) )
printf("hostDelete fei0 Error ! \n");
if(ERROR == ifRouteDelete("fei0", 0))
printf(" ifRouteDelete(fei, 0) Error ! \n");
if(OK != ipDetach(0, "fei") )
printf("ipDetach(0, fei) Error \n");
if(OK != ipAttach(1, "fei") )
printf("ipAttach(1, fei) Error ! \n");
ifMaskSet("fei1", 0xFFFFFF00);
if(OK != ifAddrSet("fei1", HOST_IP) )
printf("ifAddrSet(fei1, ) Error ! \n");
g_bLink1OK = TRUE;
g_nCurrentUseEth = 1;
printf("Set fei1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n");
//----------------从网卡2切换到网卡1--------------------------------
// if(OK != hostDelete(HOST_NAME_1, HOST_IP) )
// printf("hostDelete fei1 Error! \n");
if(ERROR == ifRouteDelete("fei1", 1))
printf(" ifRouteDelete(fei, 1) Error ! \n");
if(0 != ipDetach(1, "fei") )
printf("ipDetach(1, fei) Error ! \n");
if(OK != ipAttach(0, "fei") )
printf("ipAttach(0, fei) Error ! \n");
ifMaskSet("fei0", 0xFFFFFF00);
if(OK != ifAddrSet("fei0", HOST_IP) )
printf("ifAddrSet(fei, ) Error ! \n");
if(OK != hostAdd(HOST_NAME_0, HOST_IP))
printf("hostAdd_ fei0 Error \n");
g_bLink0OK = TRUE;
g_nCurrentUseEth = 0;
printf("Set fei0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
各位朋友们,帮忙看看,指点一下!
谢谢了!!!!
[解决办法]
该回复于2011-02-23 09:22:45被版主删除
[解决办法]
已经解决了,
if(ERROR == ifRouteDelete("fei0", 0))
printf(" ifRouteDelete(fei, 0) Error ! \n");
把上面这句删除了!
研究生的论文太xx...................