Linux HowTo: Automatically connect Wired Ethernet Connection after power outage

Original Source Link

I am using Scientific Linux 6.2 (Variant of RHEL / CentOS) . Every day at a particular time there is a power outage at my place, and after 1 hour power is restored. My laptop is connected to a network switch, that has no Backup power, and connection is disconnected when power is gone. Laptop keeps running in battery power.

Now when power is restored, the ethernet connection (eth0) is not automatically restored in linux. It only says connection available under wired connection. The same thing happens to the Wireless Network Connections. What can I do to automatically connect to these networks, whenever they are available?

NetworkManager does this automatically. It is part of RHEL/CentOS so I assume it will be available for Scientific Linux as well.

Since you have gnome environment, I will give you a GUI solution,

enter image description here

enter image description hereenter image description here

enter image description here

Tagged : / /

Making Game: Automatically connect Wired Ethernet Connection after power outage

Original Source Link

I am using Scientific Linux 6.2 (Variant of RHEL / CentOS) . Every day at a particular time there is a power outage at my place, and after 1 hour power is restored. My laptop is connected to a network switch, that has no Backup power, and connection is disconnected when power is gone. Laptop keeps running in battery power.

Now when power is restored, the ethernet connection (eth0) is not automatically restored in linux. It only says connection available under wired connection. The same thing happens to the Wireless Network Connections. What can I do to automatically connect to these networks, whenever they are available?

NetworkManager does this automatically. It is part of RHEL/CentOS so I assume it will be available for Scientific Linux as well.

Since you have gnome environment, I will give you a GUI solution,

enter image description here

enter image description hereenter image description here

enter image description here

Tagged : / /

Ubuntu HowTo: Why does Avahi mDNS address stop functioning on RPi 3B+?

Original Source Link

My layout looks like this: 1 desktop running Ubuntu 18 desktop (ubuntu-desktop.local), 1 laptop running Windows 10 (laptop.local), 1 Raspberry Pi 3 B+ (pi.local) running Ubuntu 18 Server.

Both Ubuntu computers are loaded with Avahi while the Windows machine has Bonjour. All are capable of resolving a hostname.local address. The desktop and windows laptop do not have any issues communicating with each other reliably. The RPi on the other hand intermittently stops resolving for other machines; however, it can still ping itself using pi.local, but both the laptop and desktop are unable to ping it and return ping: pi.local: Name or service not known.

It could be a coincidence, but by pinging pi.local from the raspberry pi itself, I’m able to ping it from the Ubuntu desktop with no unusual results while the laptop can resolve it to the Pi’s IP, but returns

Pinging 192.insert.pi.ip with 32 bytes of data:
Reply from 192.insert.laptop.ip: Destination host unreachable.
Reply from 192.insert.laptop.ip: Destination host unreachable.
Reply from 192.insert.laptop.ip: Destination host unreachable.
Reply from 192.insert.laptop.ip: Destination host unreachable.

Ping statistics for 192.insert.pi.ip:
Packets: Sent=4, Received=4, Lost=0 (0% Loss)

Still note that the windows machine and the ubuntu desktop can ping each other’s .local address.

Tagged : / / / /

Ubuntu HowTo: Bluetooth Audio interfering with WiFi?

Original Source Link

My Issue

Wifi is slow or completely broken when using Bluetooth headphones.

It is said that this is a well know issue as BT and WiFi share the 2.4Ghz frequency.

Is this something that could be solved? Are cheap/low end devices more problematic than quality ones?

What I Have Tried

  1. Disable coexistence in iwlwifi, run following command and reboot:

    $ sudo tee /etc/modprobe.d/iwlwifi-opt.conf <<< “options iwlwifi bt_coex_active=N”

This was only a slight improvement as it changed the speed of wifi from zero to unusably slow.

  1. Try different channels on router.

I tried both ends of the spectrum (1 and 11), neither created any improvement. Wifi still broken as soon as headphones are turned on. Setting router channel to auto has the best results so far.

System Info

$ uname -a
Linux alien-box 4.15.0-29-lowlatency #31-Ubuntu SMP PREEMPT Tue Jul 17 17:49:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

$ lspci -knn | grep Net -A3; lsusb
04:00.0 Network controller [0280]: Intel Corporation Wireless 7265 [8086:095a] (rev 59)
    Subsystem: Intel Corporation Dual Band Wireless-AC 7265 [8086:5410]
    Kernel driver in use: iwlwifi
    Kernel modules: iwlwifi
Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 006: ID 1058:07a8 Western Digital Technologies, Inc. My Passport (WDBBEP), My Passport for Mac (WDBLUZ)
Bus 004 Device 005: ID 0bc2:ab31 Seagate RSS LLC Backup Plus Desktop Drive (5TB)
Bus 004 Device 004: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 004 Device 003: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 004 Device 002: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 08bb:2902 Texas Instruments PCM2902 Audio Codec
Bus 003 Device 004: ID 28de:1142  
Bus 003 Device 003: ID 8087:0a2a Intel Corp. 
Bus 003 Device 002: ID 062a:4101 Creative Labs Wireless Keyboard/Mouse
Bus 003 Device 010: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 003 Device 009: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 003 Device 008: ID 05e3:0727 Genesys Logic, Inc. microSD Reader/Writer
Bus 003 Device 007: ID 0b33:0020 Contour Design, Inc. ShuttleXpress
Bus 003 Device 006: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 003 Device 011: ID 0d8c:0012 C-Media Electronics, Inc. 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

$ lsmod |grep 'bt|blue|rfcomm|bn'
rfcomm                 77824  4
bnep                   20480  2
btusb                  45056  0
btrtl                  16384  1 btusb
btbcm                  16384  1 btusb
btintel                16384  1 btusb
bluetooth             548864  33 btrtl,btintel,bnep,btbcm,rfcomm,btusb
ecdh_generic           24576  2 bluetooth

Bluetooth works on the same 2.4 GHz freq as Wi-Fi.

BT coexistence is bad in iwlwifi, but enabled by default.

Run

sudo tee /etc/modprobe.d/iwlwifi-opt.conf <<< "options iwlwifi bt_coex_active=N"

and reboot.

This solution worked for me (using Qualcomm Atheros module):

echo "options ath9k btcoex_enable=1"  >  /etc/modprobe.d/ath9k.conf

see details: WiFi and Bluetooth coexistence: Qualcomm Atheros ar9462: Ubuntu 16.04

Tagged : / / / /

Linux HowTo: Fiber Home AN5506-04-FA router/modem has no port forwarding option

Original Source Link

I’m trying to learn some things that involve port forwarding, but I noticed that my router (Fiber Home AN5506-04-FA) doesn’t have some options that some guides pointed out.

I’m trying this guide https://portforward.com/fiber-home/an5506-04-f2/

which is the closest of my model, since I wasn’t able to find an exact one.

Here’s a screenshot of where there should be a “Port Forwarding” option:

Image of the page where "Port Forwarding" should be.

The option should be in the left panel menu.

So, my question is: Is there any way to enable this option? If not how can I achieve the same effect without this option?

Thanks.

Tagged : / /

Linux HowTo: Match multiple strings in iptables

Original Source Link

I have 2 strings, and i wish to queue the packet if it contains both the strings ( something like (“jsh”&&”gjhyg”)), i tried following ways, but they don’t seem to work:

sudo iptables -A INPUT -p tcp -j QUEUE ! -f -m string –string “abc” –algo bm -m string –string “def” –algo bm

This doesn’t work, it only works if the packet contains the string “abcdef”, but the packet i wish to queue contains the strings at two different locations. Then I tried another method:

sudo iptables -A INPUT -p tcp -j QUEUE ! -f -m string –string “abc” –algo bm

sudo iptables -A INPUT -p tcp -j QUEUE ! -f -m string –string “def” –algo bm

But this time it works like “or”, it queues packets with string “abc” or “def”.

the “and” in this case could be achived with an user defined chain

sudo iptables -N my_chain

sudo iptables -A my_chain -p tcp -j QUEUE ! -f -m string –string “def” –algo bm

sudo iptables -A INPUT -p tcp -j my_chain ! -f -m string –string “abc” –algo bm

when the input chain process the last line and “abc” is present the control jumps to my_chain which has a similar rule checking for the presence of “def”; if “def” is there then jumps to QUEUE.

Tagged : / / /

Making Game: Fiber Home AN5506-04-FA router/modem has no port forwarding option

Original Source Link

I’m trying to learn some things that involve port forwarding, but I noticed that my router (Fiber Home AN5506-04-FA) doesn’t have some options that some guides pointed out.

I’m trying this guide https://portforward.com/fiber-home/an5506-04-f2/

which is the closest of my model, since I wasn’t able to find an exact one.

Here’s a screenshot of where there should be a “Port Forwarding” option:

Image of the page where "Port Forwarding" should be.

The option should be in the left panel menu.

So, my question is: Is there any way to enable this option? If not how can I achieve the same effect without this option?

Thanks.

Tagged : / /

Server Bug Fix: Unable to connect to Oracle database from certain client machines

Original Source Link

I have an application that connects to an Oracle database that works fine in development on any development machine I can find but falls over with the following error when being ran from a production or test server environment:

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3668)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:353)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:371)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:551)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:351)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
....

Network configuration is always a little sketchier from test and production environments here compared to development machines so my first assumption was that firewalls haven’t been properly configured but I’ve checked those and just to be sure I tried telnetting from the affected machines to the Oracle servers on the necessary port and that works fine:

[[email protected] ~]# telnet [Oracle Host IP] 1521
Trying [Oracle Host IP]...
Connected to [Oracle Host IP].
Escape character is '^]'.
^C

Connection closed by foreign host.

Is there anything else I can be missing here? Or at least any other suggestions for debugging this issue?

I figured if I can ping from the affected machine to the target Oracle server and even telnet on the port then they should be able to communicate but not sure if there’s something Oracle specific that I’m missing here.

Not an answer (at least not yet) but I need formatting.

I don’t know anything about Talend. Possibly it’s displaying the exception/stacktrace in an unusual way.
Or another possibility: I did some experimenting and I can get a stacktrace more like yours, in particular without the
cause chain, but still not identical, using an older ojdbc14.jar I have lying about from 2006.

To get at least a little light in the darkness I suggest you (store and) compile this minimal standalone app

import java.sql.DriverManager;

public class ConnectOradb {
    public static void main (String [] args) throws Exception {
        String url = "jdbc:oracle:thin:@localhost:1521:orcl";
        // may be unnecessary (but harmless) for newer versions
        Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
        DriverManager.getConnection(url, "user", "pass"); 
    }
}

changing host, port, SID, user, pw as needed, and run it, with the same ojdbc library
if there is more than one on your system, and preferably the same JRE although I doubt
that matters: /path/to/java -cp .;/path/to/ojdbc?.jar ConnectOradb

If you can’t do that, but you can determine the version of the ojdbc and it’s old and you
can try a newer, that might help.

Tagged : /

Ubuntu HowTo: Add a permanent route in 20.04

Original Source Link

Every time I start my VPN connection I have to run these commands to navigate in a website:

sudo -s route add -net 0.0.0.0 gw 192.168.0.1 metric 0 && sudo route add -net 10.0.0.0/8 tun0

Is there a way to make this automatic when the VPN connects?

I running Ubuntu 20.04 and don’t know about routes and stuff (a friend from work tell me what to do)!

Tagged : /

Ubuntu HowTo: Netplan – Multiple ssids with different static IP on the same interface

Original Source Link

I have successfully set up a wifi network configuration like this:

network:
  version: 2
  renderer: networkd
  wifis:
    wlxf8d1111b0d78:
      addresses: [10.0.0.69/24]
      gateway4: 10.0.0.138
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      dhcp4: no
      dhcp6: no
      access-points:
        WIFI_NAME_HERE:
          password: PASS_HERE

What I want to achieve is add another SSID to which I want the interface to get a different static ip (192.168.1.69) with a different gateway (192.168.1.1).

Can someone help me on how to achieve this? The various examples I’ve read have not answered this question.

Thank you in advance.

Effectively this is not supported through netplan. You can instead set renderer: NetworkManager and use your netplan config as a seed of initial configuration to NetworkManager, then manage the IP settings through NetworkManager directly.

Tagged : / /