Error when connecting (FreeRADIUS V3 & MySQL) to Mikrotik router - radius

I had setup FreeRADIUS V3 on a virtual-box that runs Ubuntu 16.04 with the using of MySQL as a database.
Also, another virtual-box running Mikrotik RouterOS to simulate a connection between the PC and router. I have configured Mikrotik as a hotspot with FreeRADIUS through the Ubuntu virtual OS.
It was running like a charm.
Now I got a physical Mikrotik router and have connected it to the ISP router's Ethernet port to replicate the connection I created previously, but when connecting to the Mikrotik router through WiFi, and after entering username and password, I get the following error message:
Radius server not responding
I opened the debug mode in radius freeradius -X, and I found radius got the Mikrotik request and replied "Access-Accept"

I had to catch my problem using the secret key which I set it up in clients.conf.
The NAS (Network Access Server) table in database is not trusted as somehow FreeRadius stops reading from it. There is some option in SQL module that makes radius read it while starting FreeRadius. Therefore, I could not use it while I am using FreeRadius. I had to restart FreeRadius to get the modified/new records.

Related

Is it possible to change the PostgreSQL hostname from localhost to IP address?

Sorry for the very elementary question.
I created a simple web app that connects with a database for learning.
PostgreSQL is using 13.
Right now, I'm running both the database and the application on my local PC, but I wanted to see if I could view this application from another PC.
The application will be created in C# and Blazor, and the connection to the database will be made using NpgSQL.
We can connect the application and database with localhost within the local PC, but we cannot connect with localhost from other PCs, so we want to change the host of PostgreSQL to an IP address.
I'm thinking of connecting a local PC (say A) and another PC (say B).
Connect the Lan cable directly to both PCs and place them under the same network.
Set the IP address temporarily as follows.
A is 192.168.1.1
B is 192.168.1.10
In this case, if I set the database connection string in the application to 192.168.1.1, am I correct in understanding that I can reference the database from both PC(A) and PC(B)?
Sorry I don't have the environment to verify this right now.

pgAdmin 4. Unable to connect to server

I had a postgreSQL server/database working in a local area network in Windows. To have access to it through Ethernet I changed the IP in the router settings. Everything was fine. But when I came today to the office, I could not have connected to the server. Moreover, I cannot even create a localhost server on that PC. The error is "Unable to connect to server:" and nothing else. When I turn off the postgres in services it specifies the error with TCP/IP, port, etc. But not when the service is on. When connecting to the server, the pgAdmin asks for the postgres password. Endlessly, thou the password is printed correctly and the METHOD is set to trust. The reinstallation did not help.
What does this error mean? And what is the cure?

How to implement proxy mode in Postgresql server

Postgresql 9.1 server is running in Debian 6 Linux under VPS and accessed by IPV4 address from clients.
I want to move it to other VPS server with never Debian and PostgresSQL 11.
How to implement this so that clients can use same IP address ?
Is it possible to force Postgres to redirect requests to other IP ?
Debian has redir demon ( https://manpages.debian.org/testing/redir/redir.1.en.html )
Is it best way to use it to redirect requests to 5432 port to other server ?
Yiu have several options:
If you control the DNS server, map the name to the new IP address.
Install pgBouncer on the old machine - in session pooling mode, it will work as a proxy.
Start an SSH tunnel on the old machine that redirects the requests to the new machine.

PGAdmin III cannot connect AWS RDS

I am trying to connect AWS RDS PostgreSql from PgAdmin 3. I followed the below link
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToPostgreSQLInstance.html
In Security Group, I also added PostgreSQL and All traffic as below
The "publicly accessible" flag was enabled (updated after Mark B's comment)
I got the error from PGAdmin3
Very appreciate for any suggestion
******UPDATE*******
I can connect pgAdminIII to AWS RDS successfully using home wifi, but cannot connect using office wifi.
My concern is:
Was the port 5432 blocked by office wifi?
How can I configure/update the port without impacting to current API?
Note: My current API is working well (CRUD)
Can you can test your connection to a DB instance using common Linux or Windows tools first?
From a Linux or Unix terminal, you can test the connection by typing the following (replace with the endpoint and with the port of your DB instance):
$nc -zv DB-instance-endpoint port
For example, the following shows a sample command and the return value:
$nc -zv postgresql1.c6c8mn7tsdgv0.us-west-2.rds.amazonaws.com 8299
Connection to postgresql1.c6c8mn7tsdgv0.us-west-2.rds.amazonaws.com
8299 port [tcp/vvr-data] succeeded!
Windows users can use Telnet to test the connection to a DB instance. Note that Telnet actions are not supported other than for testing the connection. If a connection is successful, the action returns no message. If a connection is not successful, you receive an error message such as the following:
C:>telnet sg-postgresql1.c6c8mntzhgv0.us-west-2.rds.amazonaws.com
8299
Connecting To sg-postgresql1.c6c8mntzhgv0.us-west-2.rds.amazonaws.com...Could not
open connection to the host, on port 819: Connect failed
If Telnet actions return success, then you are good to go.
If you are trying to access it from a network which is not listed for that port. you need to add inbound rules for those network IPs from AMAZON RDS system
You will also need to set Public accessibility true under Connect & security tab in RDS console.
Read this post.In your security group go to unbound rules and add my ip.
and make sure your database is public.
https://serverfault.com/questions/656079/unable-to-connect-to-public-postgresql-rds-instance

EC2 Internal Sockets

I'm trying to have two process communicate through a socket connection. One of these is a python app, and the other is a php script.
I've created and tested the client/server combination on my home computer and it functions properly. However, when I deploy onto an EC2 instance (ubuntu 10.10 64bit ami + apache + php) I get an unable to connect to socket error (111 Connection Refused) from the php script. The python app is able to bind to the socket and listen to messages but the php script is unable to send messages.
I've opened the required ports in the amazon security group and I can connect to the port externally using telnet. However if I attempt to connect with telnet from within the server I get the same connection refused error.
How can I solve this issue?
Edit: Both processes are on the same instance
The issue had nothing to do with EC2 explicitly. I was not binding to localhost, but instead binding to my hostname. On a local network that was the same as my localhost ip, however on ec2 it was not. Switching to binding to localhost fixed the issue.