Daily IT pill

What’s the difference between Windows and UNIX implementation of the tracert/traceroute tool?

Basically UNIX variants uses the UDP protocol and choose a destination port >33434 or higher, whereas the Windows implementation sends an ICMP echo request directly.

Daily tip

How do I disable IPv6 permanently on all interfaces?

Open /etc/sysctl.conf with a text editor, and add the following lines.

#to disable IPv6 on all interfaces system wide

net.ipv6.conf.all.disable_ipv6 = 1

Then run
$ sudo sysctl -p /etc/sysctl.conf

Daily tip

How do I disable the Network Manager in Redhat distros?

It can be disabled on single interfaces by adding the below line to the /etc/sysconfig/network-scripts/<IFCFG_FILE>

NM_CONTROLLED=no

And you need to restart network services.

Daily tip

How to transparently redirect HTTP requests on port 80 to a http proxy on port 8080?

By using the iptable nat

First pre-requisite is enabling IP forwarding on the system

#echo “net.ipv4.conf.all.forwarding =1”>>/etc/sysctl.conf && sysctl -p

Then issue the below iptable command

#iptables -t nat -A PREROUTING -p tcp –dport 80 -j REDIRECT –to-port 8080


Daily tip

I have installed CentOS minimal and the commands, ifconfig, netstat and traceroute are not recognized: how come?

These are considered now deprecated or legacy commands/utilities, please get more info on their equivalent (in the order):

ip
ss
tracepath

Daily tip

How to add a VLAN ID to a network interface?

First check if the the kernel module 8021q is loaded with

$lsmod | grep 8021q

if it is not loaded, load the relative module with

#modprobe 8021q

Then either

vconfig add IF VLAN_ID

or

ip add link IF name IF.VLAN_ID type vlan id VLAN_ID

Where IF is the network card interface: eth0, eth1, ens33, etc.

And VLAN_ID is the ID of your VLAN

For example if the VLAN ID is 5 and the ethernet interface is eth1, you can either run

#vconfig add eth1 50

or

#ip add link eth1 name eth1.5 type vlan id 5

You must be root or have the appropriate root permissions.