Periodically the Internet disappears in the router Mikrotik - ethernet

Good afternoon need help. There is a router Mikrotik. The Internet and wi-fi started to disappear, but the connection is periodically resumed. The Mac address is specified by my router in an error.
Error in logs : bridge port received packet with own address as source address (ee:ee:8c:0c:ee:fd), probably loop.

You need share a better environment description.
However, assuming you're using wireless interface, you can try proxy ARP on Wireless interface for avoid loops under WiFi bridge.
/interface wireless set arp=proxy-arp
More info here.

Related

No internet through GSM connection, possible interface issue

I have a problem with getting GSM connection to work.
Currently used:
Advantech UNO-2272G device
Ubuntu 18.04
NetworkManager/nmcli package
The card works when put in a mobile phone.
*Note: following screenshots are made over SSH and remotely, as the device is currently plugged in ethernet until this issue is resolved.
This is current state of "nmcli" command:
nmcli print
The system connection for GSM is called "radi". My guess is that somehow the interface of that connection is trying to work with the other interface (underlined in red), which in turn is trying to get its DNS conf from router (to which it currently is connected with ethernet, but nothing changes if device is plugged out from router and NetworkManager and network is restarted, it still tries to get to router for its DNS).
This is current state of "ip addr" command:
ip addr
This is current state of /etc/network/interfaces file:
interfaces
This is current state of /etc/NetworkManager/system-connections/radi file:
systemconnection
So, the question is, what am I missing here? Is it the interface issue as written above, or something else entirely?
Disclaimer: I am not that proficient in the stuff presented here, most if not all of it was configured following guidelines on the internet.
Hey I'm not expert in this but I do have a different cellular modem connected to a linux system (RPI) and working with NetworkManager (and ModemManager). My modem was connected by a serial UART port (ttyACM0) so that seems similar to what you have done.
When I configured my cellular connection profile in NM I had to setup the ppp section of the connection profile on top of the gsm part. I also went into my ppp options (on the host) and configured those to match a chat script that came from my modem manufacturer. WHen NetworkManager runs a ppp interface it expects the ppp options for the pppd (daemon) to be configured properly.
Here is the ppp section of my NetworkManager cellular connection settings file. Most are defaults and in my case I only added the baud rate for my modem (since it was connected to a UART).
ppp.noauth: yes
ppp.refuse-eap: no
ppp.refuse-pap: no
ppp.refuse-chap: no
ppp.refuse-mschap: no
ppp.refuse-mschapv2: no
ppp.nobsdcomp: no
ppp.nodeflate: no
ppp.no-vj-comp: no
ppp.require-mppe: no
ppp.require-mppe-128: no
ppp.mppe-stateful: no
ppp.crtscts: no
ppp.baud: 115200
ppp.mru: 0
ppp.mtu: auto
ppp.lcp-echo-failure: 0
ppp.lcp-echo-interval: 0
If this is not helpful then have a look at this thread on NM and routing. In their case eth0 was a local network interface and eth1 was their cellular interface
Now to save you 10 hours of troubleshooting - note that the route
metric is independent of the DNS priority! So if you still have
connectivity issues, make sure it's not a DNS resolution issue (eg.
your DHCP server is providing a dummy resolution service). If it is,
then increase the ipv4.dns-priority of your eth0 connection to make it
lower priority, and/or make sure the ipv4.dns-search of your eth1 is
set to "~" to make it the go-to option.

2 router in cascade with 2 DHCP and remote access

The installation is in a holidays house (so no permanent internet access)
I have a 4g-Routerm (ROUTER-1 = huawei B525-b23) that enable the internet access. I switch it on one day a week.
I have another router (ROUTER-2 = GL-MT300N-V2).
ROUTER-2 is always plugged on electricity.
On ROUTER-2 is connected through ethernet port a Raspberry-Pi3 (with Home Assistant on it).
On ROUTER-2 is connected through WIFI a Camera IP
ROUTER-1 and ROUTER-2 are connected together through ethernet.
When ROUTER-1 is not plug to electricity, none have acces to internet, but it's not an issue.
The camera save picture on the Rapbery Pi3, the Home Assistat is recording some sensor data.
When I switch on the electricity on the ROUTER-1, everyone have access to internet.
What I want is to have remote Access to my router-2 and my Rasberry and my Camera when ROUTER-1 is online
How should I do ?
Hi I can think of two solutions for this setup but both involve buying a second hand cheap router.
I think the use of a single router would make this setup a lot easier. Any router would work that supports:a USB 4g Modem to be attached to it, and has support for setting up a openvpn server and you need to be OK with leaving the Internet on all the time just make sure you dont have any services running that use up bandwidth and you should be ok. You can can connect both raspberry pi and IP camera to that router. Setup Openvpn server open the UDP port required and download the certificates, You should be able to vpn into your network and manage it through SSH or something remotely.
The second option is tailored to you but still requires swapping the 4G Modem with another one that supports these things: Wake on LAN, openvpn server, supports ssh into it over LAN and either has 4G support through a sim card slot or a usb port with modem support.
You can then have it setup so this new Router-1 is switched off with wake on lan configured on it and the raspberry pi to send the magic packet. You can use something like this to get an idea of how WoL https://www.lifewire.com/wake-on-lan-4149800. You can use cron on your raspberry pi to send WoL signal to Router 1 once a week which would eventually give you internet access once the router is up. You have to setup a vpn server on it and forward the required port and download the certificates. When your scheduled WoL cron runs make sure you are able to connect through vpn then access network resources you wish, at the end when you are done you can ssh into the router-1 and turn it off.
I hope this helps. I had a look at the router models you are using and it doesnt leave you with many options. You can get cheap second hand routers online that support everything that is required.

Communicating between networks using sockets

I have a question about network connections among computers.
I've made some applications where messages pass through the Internet (via sockets) to make a connection between two devices. However, a strong condition is that two devices must be connected to the same network.
Can anyone give me a trick how to create a communication using sockets between two computers even if they are connected to different netwkorks?
Thank you in advance.
Here is a great tutorial on how to use sockets and general networking
(in java) http://www.thenewboston.org/watch.php?cat=25&number=38
In order to communicate between two diffrent networks over the internet, you will need to do something called port forwarding. What that does is that when your public IP of your network receives a packet with a spesific port number. The router knows where to send that packet to which local IP.
If you dont port forward and receive some data. The router doesent know where to send the packet. Therefore it discards it, which means others wont be able to connect to you.
You will only need to port forward the network with your server (using the example i linked). How you do that is by logging in to your router, and say that a port which the server uses gets forwarded to the IP of the PC hosting the server.
On the other network (client) you will need to change the IP address of which the client shall connect to. That IP address needs to be your public IP of your server's network. You can find that by connecting to the server's network and go to: http://www.whatsmyip.org/ . Keep in mind that public IP addresses may change over time.
Hope this helped!
-Kad

How to communicate between two embedded devices over ethernet?

I am not expert on this subject, need your suggestions. I have a few devices on ethernet/LAN. I wanted to have these devices communicate over LAN without going into their network configurations. Below is my plan, please let me know if this can be achievable:
1) I install TCP/IP stack on these devices
2) I give them their hostnames like device1, device 2 etc....
3) I configure these devices for local-link networking, so that they can configure themselves and get their IPs.
4) I use socket programming and access each device by using hostnames.
Please let me know if this can be done without much hassle, and let me know if I have missed out something in above mentioned points.
Thanks in advance.
This is basically a good approach.
If your embedded devices have a good IPv6 stack, I recommend using it instead of IPv4. link local addresses work better with IPv6. Most IPv4 stacks are configured to try to obtain an address from a DHCP server first, and only fall back to link local addresses if they can't get one. The link local address and DHCP address might be mutually exclusive, so the link local address doesn't become operational until after DHCP has been tried and timed out. The link local address might even be disrupted if DHCP periodically retries. Although the devices will normally be connected to each other and there won't be a DHCP server, you don't want to disable DHCP, because the devices probably should obtain a DHCP address if they are ever connected to a wider network. With IPv6 on the other hand, the link local addresses come up immediately when the interface comes up, and stay up continuously while other IP addresses (from autoconf or from DHCPv6) may come and go.
Link local addresses alone won't let the devices contact each other by hostname, but dns-sd (mDNS, zeroconf) will. If you are using Linux then you can use avahi as a dns-sd stack.
Better than using hostnames, consider having the devices probe for each other by dns-sd service type. If you are using a custom protocol between your devices, make up a unique service tpe name and have the devices advertise themselves it and probe for it with dns-sd.

Peer to peer over 3G

Hey I'm trying to get a CFStream connection going over 3G. I can get it working over wifi using the host name, but when I try to connect directly to the ip address it fails.
Is there a guide out there on how to connect over 3G?
Thanks
ASH
You can use NAT traversal in some cases. This is not a guaranteed method and depends on the type of NAT so you will still need a relay server if you want to guarantee connectivity.
A general rule is if both clients are behind symmetric NATs then a relay server is required.
If only one NAT is symmetric then STUN, ICE, methods can be helpful in establishing P2P connections.
The following might help you:
Interactive Connectivity Establishment see en.wikipedia.org/wiki/Interactive_Connectivity_Establishment
PJNATH Open source project for NAT traversal in SIP/VoIP solutions see PJSIP.ORG
When you are connected to 3G then you are usually behind a router that implements some 'NAT' scheme. This means that your iPhone gets a private internal IP address on the inside (the 3G network) and a shared 'real' public IP address on the outside (the Internet).
This is all fine when you are just a client connecting to services on the Internet, but it will fail horribly when you try to connect to other clients in the same situation.
There is no simple solution for this. Programs like Skype work around this problem by using intermediate servers with public IP addresses that can relay network traffic between hosts behind such 'NATted' networks.