Ip Aliases - sending packets from aliases?

Ip Aliases - sending packets from aliases?

Post by Geoff Won » Thu, 22 Apr 1999 04:00:00



Hi,

The following question relates to IP aliases.
I'm not sure if the groups I've posted to are the correct
place - but I couldn't find a really correct group.
Bear with me if you've any expertise in programming IP Aliases.

If I have the following IP aliases configuration
(IP numbers changed to protect the innocent :-):

eth0      Link encap:Ethernet  HWaddr 00:48:54:01:28:61  
          inet addr:10.0.0.172  Bcast:10.0.0.175  Mask:255.255.255.248
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:921326 errors:0 dropped:0 overruns:0 frame:0
          TX packets:92310 errors:4 dropped:0 overruns:0 carrier:10
          collisions:8167
          Interrupt:10 Base address:0xd000

eth0:1    Link encap:Ethernet  HWaddr 00:48:54:01:28:61  
          inet addr:10.0.0.173  Mask:255.255.255.255
          UP RUNNING  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0

eth0:2    Link encap:Ethernet  HWaddr 00:48:54:01:28:61  
          inet addr:10.0.0.174  Mask:255.255.255.255
          UP RUNNING  MTU:1500  Metric:1
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0

It's relatively easy to write code that will listen()
on each of these interfaces. I've been going mad trying
to get the "reverse" to work.

Is it possible to write code under Linux that allows outgoing
packets (after a connect(), etc) to come from the aliased
interfaces (eth0:1, etc) rather than simply eth0?

If so; could someone point me at the correct ioctl()
or the socket options or even a snippet of code.

Please remove the "eatspam" from my reply address to
send to me if you reply directly.

thanks,
Geoff

 
 
 

Ip Aliases - sending packets from aliases?

Post by Geoff Won » Fri, 23 Apr 1999 04:00:00




>> If so; could someone point me at the correct ioctl()
>> or the socket options or even a snippet of code.
>Use bind(2) to the alias before the connect.  After a connect
>the local address cannot be changed anymore for obvious reasons.
>bind can only be called once on a socket.

Bind only works when listening to an alias.
It doesn't work for sending.

Geoff

 
 
 

1. aliases, aliases, aliases...

Hey everyone,
    I was just wondering if anyone out there would be kind enough to
lend some advice on what the best alias management procedure is
available for distributed mail servers on a WAN with one single
Internet connection.  There has been talk about NIS/NIS+ and rdist.
But how about RCS or maybe others that someone might strongly
recommend.  Any ideas or tips?

Thanks for the help,
John

---------------------
Trident Data Systems

2. xp linux pdc

3. script alias problem - Re: apache alias and script alias problem

4. SYSV - ipc

5. between Network aliasing and IP aliasing???

6. Problems with openSSH on RH6.2 DS20E Alpha box

7. sending packets from alias address

8. Q: 8|24 bpp

9. IP Aliases and address selection of outgoing packets

10. ip aliasing/packet forwarding???

11. email send-receive problems through two ip aliases

12. send email from an IP that is aliased

13. Configuring net (IP-tunnel, IP-Alias, Proxy-ARP, NAT, IP-Masq?)