Linux

Restart Netowork in RHEL 9/Almalinux 9/RockyLinux 9 with nmcli

After manually configuring your network settings (static IP, etc..) you’ll have to reload and restart the interface for the changes to take effect. Reload connection profile nmcli connection reload   Restart connection nmcli connection up ifname eth0 OR Restart device nmcli device down eth0;nmcli device up eth0   Where eth0 is the device name.   […]

Restart Netowork in RHEL 9/Almalinux 9/RockyLinux 9 with nmcli Read More »

OpenVPN Route Private traffic only (OpenVPN Server on linux)

You can route specific subnet via OpenVPN and the rest of the traffic will be routed to the default PC gateway. Note: this is valid on OpenVPN installations on Linux that have been installed using this installation script: https://github.com/angristan/openvpn-install   Open OpenVPN server.conf file: /etc/openvpn/server.conf Remove or comment out the following lines: push “dhcp-option DNS

OpenVPN Route Private traffic only (OpenVPN Server on linux) Read More »

restart network RHEL 8/Almalinux 8

An updated version of this article is available here: Restart Netowork in RHEL 9/Almalinux 9/RockyLinux 9 with nmcli   You can restart the network on RHEL 8 as follows: nmcli networking off; nmcli networking on To restart NetworkManager service sudo systemctl restart NetworkManager To restart an individual network interface, you can use the following (where

restart network RHEL 8/Almalinux 8 Read More »

Make CSF work with OpenVPN

To make CSF work with OpenVPN, you’ll need to create extra iptable rules. We do that by adding them to csfpre.sh. nano /etc/csf/csfpre.sh If the file does not exist, you can create it. If it already exists, you should append to it. iptables -A FORWARD -m state –state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -s

Make CSF work with OpenVPN Read More »

find&replace text with bash on CENTOS/RHEL

You can find and replace text on one or multiple file at once using sed RHEL command   sed -i ‘s/TEXT-TO-FIND/REPLACE-WITH/g’ filename.txt   Find and replace text on multiple files with .txt extention sed -i ‘s/TEXT-TO-FIND/REPLACE-WITH/g’ *.txt Replace TEXT-TO-FIND and REPLACE-WITH with the text you’re looking for and its replacment Example: sed -i ‘s/thursday/friday/g’ weekdays.txt The

find&replace text with bash on CENTOS/RHEL Read More »