Showing posts with label linux networking. Show all posts
Showing posts with label linux networking. Show all posts

Wednesday, September 10, 2025

enable port forwarding on ubuntu

 



check current value
sysctl net.ipv4.ip_forward
set to enabled
sudo sysctl net.ipv4.ip_forward=1
Persist across boots
sudo nano /etc/sysctl.conf
# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1



reference:

--30--

Saturday, September 18, 2021

add a route to a specific IP on linux to get to a remote emulated system


Note on how to add a route on a system remote to an host for an emulated system.

Use case.  A system with TCP/IP configured is running on a host with a local IP for the emulated system, and a gateway IP on the host.  The latter  is on a tun/tap NIC on the host system.

one can access the emulated system from the network on the host system.  But the gateway tun/tap device isn't shared on the external network.

example
[hercules guest]
ip xxx.201  NIC internal to OS
[CTCA bridge]
ip xxx.151  NIC tun/tap on host running hercules
[Host system]
ip xxx.136 NIC is enp0 ethernet NIC for host.
[subnet]
xxx/24

[remote system]
ip xxx.172

traffic for the xxx.151 ip isn't bridged out of the [Host system]

ip route add xxx.151 via xxx.136 dev enp0s25 executed on the [remote system]
allows programs on remote system access the [hercules guest]






--30--

Wednesday, April 18, 2018

Centos and Redhat EL firewall port opening


http://ask.xmodulo.com/open-port-firewall-centos-rhel.html

Centos 7
To open up a new port (e.g., TCP/80) permanently, use these commands.
$ sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
$ sudo firewall-cmd --reload 
 
Check the updated rules with:
$ firewall-cmd --list-all
 
Centos 6, iptables
Use iptables command to open up a new TCP/UDP port in the firewall. To save the updated rule permanently, you need the second command.
$ sudo iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
$ sudo service iptables save 
 
Start / Stop / disable firewall completely
 
 

-30-

Monday, September 25, 2017

Network monitoring tools command line, Linux


Testing various command line tools, which use ncurses or other to display data on a terminal on Linux command line.

Sources of ideas:

https://askubuntu.com/questions/257263/how-to-display-network-traffic-in-the-terminal

Installs via apt-get:

bmon:  Very detailed, not a bad load.
    Tested on Asus Tinkerboard (arm, rpi clone)

wavemon:  can apt-get
   https://github.com/uoaerg/wavemon

slurm:

tcptrace:

iftop:

fping:
  https://stackoverflow.com/questions/503171/send-a-ping-to-each-ip-on-a-subnet

nethogs:

iptraf:

ifstat:

sysstat:
sar -n DEV  1

enter image description here


speedometer:
sudo apt-get install speedometer
$ speedometer -l  -r wlan0 -t wlan0 -m $(( 1024 * 1024 * 3 / 2 ))


Sunday, August 6, 2017

set static IP from command line gui Armbian / Debian 7 Orange Pi Zero 512


Recently I acquired a couple of OrangePi Zero 512's, with a network phy, and dual usb.  The latter is not terribly useful because w/o modification to physically drive in more +5 there isn't much 5 v to spare on either port of this board.  It is powered by a USB OTG micro port, which at most will draw 2.1A.

The armbian comes up with the root password set to "1234" and a script to force changing the password at first login.  One can log in to either the serial port (presented on the OTG as a USB serial), you may wire in a serial port, or ssh into the unit once you find it.

The latter is a bit of a problem, however.  For whatever reason the current armbian is set up to assign a random crap MAC address to the board.  There is no retention of a MAC in any storage, so that isn't a huge problem.  However, the MAC must be being set early enough that there isn't any of the static storage of the root available, so no static address.

Against my desire and policy here, I decided to set a static IP to the board, which skirts the need for a static MAC.  I usually like to have everything DHCP so I can change any device by the dhcp server, but static IP will work to get round this.

to set the IP, one has to edit the ip with the network manager.  the network manager may be edited with the nmgui command.  Edit the ip from automatic to manual, and set up the IP.

The only caveat that needs to be recalled is that there is no netmask.  The gui uses the format of
192.168.0.1/24 or such to set the netmask.  Kind of against command line and file standards, but that took some hunting for when the setup failed for me a few times.  And there is no netmask prompt.

One can either reboot the system, or restart the network manager.  Seems like on a systemd type system this does that task

sudo service network-manager restart

********* on the topic of armbian  ****

this method didn't work for the orangepi to change the configuration.  Should work on some form of debian, but somewhere else must be some network code setup on armbian that ignores the settings in the /etc/networking directory configuration files.  Has no effect at all.

https://kuziel.nz/notes/2017/01/orange-pi-zero-armbian-setup.html