Two eth interfaces in one subnet
Alex Zolotov
nightradio at gmail.com
Wed Jan 23 03:39:30 UTC 2008
Hello all!
I want to use two ethernet interfaces with IP addresses in one subnet.
Configuration part of my program is below.
extern void rtems_bsdnet_loopattach();
static struct rtems_bsdnet_ifconfig loopback_config =
{
"lo0", /* name */
(int (*)(struct rtems_bsdnet_ifconfig *, int))rtems_bsdnet_loopattach,
NULL, /* link to next interface */
"127.0.0.1", /* IP address */
"255.0.0.0", /* IP net mask */
};
static struct rtems_bsdnet_ifconfig eth1_config =
{
"eth1", /* name */
rtems_vmac_attach, /* attach (FPGA EMAC) */
&loopback_config, /* link to next interface */
192.168.1.48, /* IP address */
"255.255.255.0", /* IP net mask */
ethernet_address1, /* Ethernet hardware address */
0
};
static struct rtems_bsdnet_ifconfig eth0_config =
{
"eth0", /* name */
RTEMS_BSP_NETWORK_DRIVER_ATTACH, /* attach (ARM EMAC) */
ð1_config, /* link to next interface */
192.168.1.47, /* IP address */
"255.255.255.0", /* IP net mask */
ethernet_address0, /* Ethernet hardware address */
0
};
struct rtems_bsdnet_config rtems_bsdnet_config =
{
ð0_config, /* Network interface */
NULL, /* Use fixed network configuration */
0, /* Default network task priority */
128*1024, /* Default mbuf capacity */
256*1024, /* Default mbuf cluster capacity */
"testSystem", /* Host name */
"nowhere.com", /* Domain name */
"",
"", /* Log host */
{""}, /* Name server(s) */
{""} /* NTP server(s) */
};
(ethernet_address0 and ethernet_address1 are different)
But i got following error: "Can't set eth1 address: File exists"
And after that eth0 working only.
Help me, please.
Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20080123/d949b1c4/attachment.html>
More information about the users
mailing list