cheers
Harjinder
> What calls do I need to make to give an Ethernet interface 2 IP addresses?
>
Use ifAddrAdd() in ifLib.h
ifAddrAdd (char* interfaceName,char* interfaceAddr, char*
broadcastAddr, int subnetmask);
Try for example :
ifAddrAdd "motfcc0","192.168.101.100","192.168.101.255",0xffffff00
<enter>
hth,
vasu
ifAddrSet
ifMaskSet
for the 1st address
ifAddrAdd
for subsequent addresses
toni
As I understand TCP/IP networking, the additional IP address added by
ifAddrAdd() should be from the same subnet. Am I correct ?
From my TCP/IP knowledge the subnet or network part of IP address on the
same subnet should be the same.
Martin
Mailto:bmr...@email.mot.com
"Toni Kurzberger" <gon...@gmx.at> wrote in message
news:8400a733.03010...@posting.google.com...
Speaking only for myself,
Joe Durusau
Actually it's different. VxWorks is prepared to handle n fully
routeable addresses on a single interface. All of them have to be on
different networks. E.g.:
fei0 123.123.123.123:ffffff00
fei0 12.12.12.12:ffff0000
=> Would be legal and should work.
fei0 123.123.123.123:ffffff00
fei0 123.123.123.124:ffffff00
=> Will most likely cause trouble with VxWorks.
I'm not sure about the standard RIP and OSPF... in case you plan using
them it should be checked whether they can handle multiple networks on
a single interface.
At least this is something the routing code of the SENS stack is
prepared to handle.
toni
Martin
Mailto:bmr...@email.mot.com
"Toni Kurzberger" <gon...@gmx.at> wrote in message
news:8400a733.03010...@posting.google.com...
What Toni describes here, if true, is a bug in the IP stack. The IP
stack should handle multiple addresses on same subnet.
Andrei
What Toni describes here, if true, is a bug in the IP stack. The IP
stack should handle multiple addresses on same subnet.
Andrei
> > I'm not sure about the standard RIP and OSPF... in case you plan using
"Andrei" <iub...@yahoo.com> wrote in message
news:371e4594.0301...@posting.google.com...
This situation is also called 'interface aliaing', or 'multihoming'.
While normally not needed, here is an example when you do need it.
On your local ethernet network, there may be multiple IP subnets
defined. If you use only one interface, you can talk directly to just
one of the subnets, and have to rely on a gateway to route packets
from you to the other subnets. Instead, you can use interface aliases
to talk directly to all the other subnets.
> I can think of security reasons to grant some applications to use one IP
> address and other applications to use a different IP address.
Once an interface is defined, all applications can use it. I don't
know any OS that allows permission setting on an IP interface, and
that checks the process user id/group id (similar to how file
permissions work). The only permission restriction, on UNIXes and
Windows (not sure of VxWorx, does it support user permisions?), is
that applications can bind to port numbers < 1024 only if they have
root permission.
> I think if both addresses are routable, - they should be on the same subnet.
> I can accept one routable address and one private address. In this case the
> routable address can be used by the external world to access low security
> applications.
> The private IP address (for the same interface) can be used to access
> applications that should not be exposed to external networks.
What you're trying to do is difficult, but not impossible. It is
similar to the ipchains concept that Linux has. If VxWorks implements
hooks at the ethernet driver level which you can use to make it drop
incoming packets based on their src/dest IP address... it could be
done. For example, the OSE real-time system has that capability.
An easier approach would be to deal with security at the application
layer.
Andrei Radulescu-Banu