Selecting which IP address to respond to

14 views
Skip to first unread message

Anders Persson

unread,
Mar 20, 2023, 12:08:00 PM3/20/23
to Eiffel Web Framework
Hi

I have created an extra IP address on one network interface. I have now for example 192.168.50.10 and 192.168.50.11 

I would like to run one EWF webserver that respons to one of the IP addresses and one to the other. 

Any suggestions where to start reading?

Regads

Anders

Anders Persson

unread,
Mar 23, 2023, 1:46:03 PM3/23/23
to Eiffel Web Framework
I  have made some progress and I think I need to get it to work like this C-example:

=================================================
int sockfd = socket(AF_INET, SOCK_STREAM, 0);
struct sockaddr_in localaddr;
localaddr.sin_family = AF_INET;
localaddr.sin_addr.s_addr = inet_addr("192.168.1.100");
localaddr.sin_port = 0;  // Any local port will do
bind(sockfd, (struct sockaddr *)&localaddr, sizeof(localaddr));
=================================================

I tried to set the server_name to 192.168.1.100 in the .ini file but it did not work, it did not handle it correct and it failed. I tried with setting a string like telia.com and that was reflected in the system but it of course failed when it tried to use it.

Regards

Anders

Jocelyn Fiat

unread,
Mar 20, 2024, 11:41:53 AMMar 20
to Eiffel Web Framework
I don't know how to achieve that.
Is this even possible?
Maybe with 2 network cards, but I don't know how.
If ever you have an example (C code, or else) doing that, I would be interested.

If I had to do that, I guess I would use a reverse proxy.
Reply all
Reply to author
Forward
0 new messages