DHCP server providing two IP addresses to the same Host - linux

I have two subnets (A and B) in the same local area network where all IP addresses are static. I just created a DHCP server to solve the problem of IP address conflict.
The problem that there are Hosts that must belong to both Subnets and therefore have two IP addresses.
The router solution is not accepted because if a subnet A station wants to access a station in network B, it must go through the router, but the traffic is very important (SQL queries for statistics) which can cause the flood of the router.
Short: Can I configure my DHCP server to provide two IP addresses to the same Host?
Server operating system: Linux Suse (DHCPD)

This is not a DHCP problem, it's a routing problem.
AFAICT DHCP only lets you specify one IP address per client, but it also lets you push static routes.
You do not need your client to have an IP on both networks, you just need it to know which route to use to reach peers on network A and B (ie direct route in both cases).
See https://gauvain.pocentek.net/docs/dhcpd-push-routes/ to specify static routes for DHCP.

Related

What's the point of outbound IP addresses in an Azure App Service?

Taken from this article.
Any outbound connection from the App Service app, such as to a
back-end database, uses one of the outbound IP addresses as the origin
IP address.
Why can't it just use the inbound IP address, which I thought would be the IP address of the VM or whatever it is that is running the app service?
Does this mean if my app service calls an API, that API would receive a request with one of the outbound IP addresses as the value for X-Forwarded-For?
How does it know which IP address to use?
Why does it need multiple outbound IP addresses?
Why can't it just use the inbound IP address, which I thought would be the IP address of the VM or whatever it is that is running the app service?
The inbound IP is not a virtual machine, but a load balancer IP, otherwise, when you scale out, you would need to know multiple Inbound IP addresses and configure yourself a load balancer for the instances.
Does this mean if my app service calls an API, that API would receive a request with one of the outbound IP addresses as the value for X-Forwarded-For?
If you don't have any proxy or application gateway, then yes.
How does it know which IP address to use?
Every TCP and UDP packet contains a source port number and a
destination port number. Each of those packets is encapsulated in an
IP packet, whose IP header contains a source IP address and a
destination IP address.
https://en.wikipedia.org/wiki/Network_address_translation
Why does it need multiple outbound IP addresses?
Depending on your SLA uptime, you may need to host your application in multiple regions / availability zones. Which means, the datacenters won't have the same IP Addresses, reason why it has many outbound ip addresses.
There is an entire article on docs which talks about the different IP address when it comes to App Services: https://learn.microsoft.com/en-us/azure/app-service/overview-inbound-outbound-ips
To get a single outbound IP address, you could, for example, use VNet-integration your App Service and then use NAT Gateway or Azure Firewall for egress.

SoftEther VPN Setup: Multiple NIC configuration

Config:
Windows Server 2019 (VM on Azure)
2 Virtual NICs (Each with a static private address and corresponding public IP address on Azure)
Managed to install and configure SoftEther VPN Server and it works great!
But I am unable to achieve the following configuration:
Let's say I have
first NIC with IP xxx.xxx.xxx.xxx, and
second NIC with IP yyy.yyy.yyy.yyy
Now, client A, when connected should have his public IP Address as xxx.xxx.xxx.xxx
And, client B, when connected should have his public IP Address as yyy.yyy.yyy.yyy
I have tried to create multiple Virtual Hubs but couldn't find any option to make this mapping.
Please advise. Thanks in advance.
For achieving VPN server which assigns multiple IPs to clients you can try Clustering function with multiple servers.
But if you only have 2 clients and dont want to use multiple servers then with your above setup create client1 on VirtualHub1 and client2 on VirtualHub2.
I haven't tried it ever but i think it should work.
Ofcourse make sure VHub1 and VHub2 are bridged to different Network Adapter

How to use iis with friendly name on local network

I make a web site to my local. I set bindings local.com and www.local.com. I add hosts xml to
127.0.0.1 local.com
127.0.0.1 www.local.com
So, I can connet on my pc like
local.com,
www.local.com,
192.168.1.35
But another pc on my network can't conenct with friendly name
www.local.com,
local.com,
But same pc can connet with ip
192.168.1.35
How can that another pc connect with friendly name ?
IP Addresses are the numerical identification for each device on a computer network.
Named Addresses invented, because remembering each device Address's turned to a difficult job.
So someone must know's which names must be converted to which IP Address.
DNS Servers are responsible to do this translation. But you done that locally. Actually you don't have a DNS Server on your local System, So you can't tell to others that "WWW.Something.COM" is my Address.
If you didn't connected to the internet, you must establish a DNS Server or done this task manually in all clients:
https://helpdeskgeek.com/networking/edit-hosts-file/
Running a DNS Server is another task. you can search for DNS Server applications like https://simpledns.com/ or you can setup a DNS Server using Windows Server. for both scenarios you need to tell to your clients to add your DNS Server Address to their network Adapter settings.
or If you are connected to the Internet, you can Use a NoIP to register a free Address:
https://www.noip.com/
you then need to download an application (In Noip.com) to monitor IP changes, it will monitors your IP address and it changes and then tells to NOIP.com to translate your address into your current IP address.
Actually NOIP will registers your address globally around the Internet network and each one who can access to the internet is able to reach to your address.

Could I use avahi to publish service across subnetworks?

Avahi is usually used for service discovery. I want to make a service discoverable from a different subnetwork, could I use avahi to achieve this?
For example, the service host ip is "192.168.1.100" with mask "255.255.255.0", so it's in 192.168.1.X subnetwork. Another host ip is "192.168.2.100" with mask "255.255.255.0". Could I use avahi to let this host discover the previous service host?
Unfortunately, no, it's going to require reconfiguration of whatever device is routing between those two subnets. mDNS uses the multicast addresses 224.0.0.251 for IPv4 and ff02::fb for IPv6. Those are link-local addresses and the data sent to them is typically not routed outside of the current subnet.
There are various options, some may be easier than others depending on what your routing device is.
Multicast Proxying. mdns-repeater is a simple solution that will repeat mDNS requests across interfaces.
Wide Area DNS. Wide-Area DNS-SD could be enabled on the DNS resolver that is service the hosts in those subnets. Avahi could then be configured to publish not the .local domain but to the domain for those subnets.
Multicast Routing. The device routing between those subnets could be configured to route the multicast groups between those two subnets.
mDNS Gateway. There is a draft RFC for implementing a mDNS gateway that sits at the edge of a network segment (typically a router). This is not a simple repeater/reflector, but a gateway that caches service entries and responds to queries from other connected network segments.
Sure you can. It's called a reflector and it's part of the Linux avahi daemon.
Look at "SECTION [REFLECTOR]" of man avahi-daemon.conf on your distribution.

how/where to add rDNS for an IP address

how/where to add a rDNS entry for an IP address in centos box. i am going to use my secondary IP address in postfix.
If it's just for your local machine (eg. 10.0.0.1 etc), it goes into /etc/hosts.
If it is for a public IP, you need to contact your provider (the owner of the netblock) as they have to configure this in their DNS. Colocation providers may have web interfaces for this, but consumer-access providers typically won't let you do it.

Resources