pip install git+https://github.com/ktbyers/netmiko.git
Linux Tips & Tricks
Tuesday, March 22, 2022
Monday, July 27, 2020
Fedora : Assigning static IP address and static route
Enable the network interface
ip link set ens224 up
Assign IP address to the interface
ip address add 172.6.128.8/24 dev ens224
Check IP address is assigned
ip addr show dev ens224
Add static route
ip route add 172.0.0.0/8 via 172.6.128.254 dev ens224
ip link set ens224 up
Assign IP address to the interface
ip address add 172.6.128.8/24 dev ens224
Check IP address is assigned
ip addr show dev ens224
Add static route
ip route add 172.0.0.0/8 via 172.6.128.254 dev ens224
Check route
ip -4 route show
Sample:
[root@localhost ~]# ip link set ens224 up
[root@localhost ~]# ip address add 172.6.128.8/24 dev ens224
[root@localhost ~]# ip addr show dev ens224
3: ens224: mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:b9:01:a7 brd ff:ff:ff:ff:ff:ff
altname enp19s0
inet 172.6.128.8/24 scope global ens224
valid_lft forever preferred_lft forever
[root@localhost ~]# ip route add 172.0.0.0/8 via 172.6.128.254 dev ens224
[root@localhost ~]#
[root@localhost ~]# ip -4 route show
default via 100.104.78.254 dev ens192 proto static metric 100
100.104.78.0/24 dev ens192 proto kernel scope link src 100.104.78.195 metric 100
172.0.0.0/8 via 172.6.128.254 dev ens224
172.6.128.0/24 dev ens224 proto kernel scope link src 172.6.128.8
[root@localhost ~]#
[root@localhost ~]# ip link set ens224 up
[root@localhost ~]# ip address add 172.6.128.8/24 dev ens224
[root@localhost ~]# ip addr show dev ens224
3: ens224:
link/ether 00:50:56:b9:01:a7 brd ff:ff:ff:ff:ff:ff
altname enp19s0
inet 172.6.128.8/24 scope global ens224
valid_lft forever preferred_lft forever
[root@localhost ~]# ip route add 172.0.0.0/8 via 172.6.128.254 dev ens224
[root@localhost ~]#
[root@localhost ~]# ip -4 route show
default via 100.104.78.254 dev ens192 proto static metric 100
100.104.78.0/24 dev ens192 proto kernel scope link src 100.104.78.195 metric 100
172.0.0.0/8 via 172.6.128.254 dev ens224
172.6.128.0/24 dev ens224 proto kernel scope link src 172.6.128.8
[root@localhost ~]#
Monday, January 25, 2016
Install TP Link wifi adapter driver in Debian
Install TP Link wifi adapter driver in Debian:
1. Download TP Link wifi adapter driver from this link
https://github.com/lwfinger/rtl8188eu
2. Extract the zip file
3. Open terminal and go the directory having the extracted files
4. Become root user
5. Execute 'make'
6. Execute 'make install'
7. Execute 'depmod -a'
8. Execute 'update-initramfs -u'
9. Execute 'modprobe'
10. Wifi is ready now!
1. Download TP Link wifi adapter driver from this link
https://github.com/lwfinger/rtl8188eu
2. Extract the zip file
3. Open terminal and go the directory having the extracted files
4. Become root user
5. Execute 'make'
6. Execute 'make install'
7. Execute 'depmod -a'
8. Execute 'update-initramfs -u'
9. Execute 'modprobe'
10. Wifi is ready now!
Saturday, December 28, 2013
Nvidia driver installation in Fedora 20
Follow the below steps to install nvidia drivers
1. Enable access to RPM Fusion non free repository
yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm2. Install kernel-devel and nvidia packages.
yum install kernel-develyum install akmod-nvidia xorg-x11-drv-nvidia-libs
3. Reboot the PC
Sunday, August 16, 2009
Adding ntfs partitions in fstab
This section describes how to add the ntfs partitions in the fstab so that they will get mounted automatically while bootup itself
1. Find the partitions which are ntfs
/dev/sda1, /dev/sda6, /dev/sda7 are ntfs partitions in my system.
saravanan@saravanan-desktop:~$ sudo fdisk -l
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0f4a0f4a
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6081 48838656 7 HPFS/NTFS
/dev/sda2 6082 30401 195350400 5 Extended
/dev/sda5 8154 11800 29294496 83 Linux
/dev/sda6 11801 17598 46572403+ 7 HPFS/NTFS
/dev/sda7 17599 30401 102840066 7 HPFS/NTFS
/dev/sda8 6082 6329 1991997 82 Linux swap / Solaris
/dev/sda9 6330 8153 14651248+ 83 Linux
Partition table entries are not in disk order
saravanan@saravanan-desktop:~$
2. Create three directories for mounting the three ntfs partitions (name it as you wish).
saravanan@saravanan-desktop:~$ sudo mkdir /media/windows
saravanan@saravanan-desktop:~$ sudo mkdir /media/media
saravanan@saravanan-desktop:~$ sudo mkdir /media/download
3. Add the following lines to the end of the /etc/fstab file.
/dev/sda1 /media/windows ntfs-3g defaults,force 0 0
/dev/sda6 /media/media ntfs-3g defaults,force 0 0
/dev/sda7 /media/download ntfs-3g defaults,force 0 0
4. The content of the fstab file will now be like this,
saravanan@saravanan-desktop:~$ sudo cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'vol_id --uuid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#
proc /proc proc defaults 0 0
# / was on /dev/sda9 during installation
UUID=a279e8ee-83fa-4fcc-afd7-6ca8ea508fb4 / ext4 relatime,errors=remount-ro 0 1
# /home was on /dev/sda5 during installation
UUID=c8203577-d56f-4806-bf3c-95e8d0508cc4 /home ext4 relatime 0 2
# swap was on /dev/sda8 during installation
UUID=c9bcea3f-1d09-4787-b95a-730664fdf7a7 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/sda1 /media/windows ntfs-3g defaults,force 0 0
/dev/sda6 /media/media ntfs-3g defaults,force 0 0
/dev/sda7 /media/download ntfs-3g defaults,force 0 0
saravanan@saravanan-desktop:~$
5. You can either reboot the system to check that the partitions are getting properly mounted (OR) You can mount the partitions using 'sudo mount -a' command
Note: The 'force' option in the fstab file is used to force mount the partitions in case of unclean shutdown. Normally if there was a unclean shutdown, the ntfs partitions will not be automatically mounted during the bootup. To avoid this, the 'force' option is added.
1. Find the partitions which are ntfs
/dev/sda1, /dev/sda6, /dev/sda7 are ntfs partitions in my system.
saravanan@saravanan-desktop:~$ sudo fdisk -l
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0f4a0f4a
Device Boot Start End Blocks Id System
/dev/sda1 * 1 6081 48838656 7 HPFS/NTFS
/dev/sda2 6082 30401 195350400 5 Extended
/dev/sda5 8154 11800 29294496 83 Linux
/dev/sda6 11801 17598 46572403+ 7 HPFS/NTFS
/dev/sda7 17599 30401 102840066 7 HPFS/NTFS
/dev/sda8 6082 6329 1991997 82 Linux swap / Solaris
/dev/sda9 6330 8153 14651248+ 83 Linux
Partition table entries are not in disk order
saravanan@saravanan-desktop:~$
2. Create three directories for mounting the three ntfs partitions (name it as you wish).
saravanan@saravanan-desktop:~$ sudo mkdir /media/windows
saravanan@saravanan-desktop:~$ sudo mkdir /media/media
saravanan@saravanan-desktop:~$ sudo mkdir /media/download
3. Add the following lines to the end of the /etc/fstab file.
/dev/sda1 /media/windows ntfs-3g defaults,force 0 0
/dev/sda6 /media/media ntfs-3g defaults,force 0 0
/dev/sda7 /media/download ntfs-3g defaults,force 0 0
4. The content of the fstab file will now be like this,
saravanan@saravanan-desktop:~$ sudo cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'vol_id --uuid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#
proc /proc proc defaults 0 0
# / was on /dev/sda9 during installation
UUID=a279e8ee-83fa-4fcc-afd7-6ca8ea508fb4 / ext4 relatime,errors=remount-ro 0 1
# /home was on /dev/sda5 during installation
UUID=c8203577-d56f-4806-bf3c-95e8d0508cc4 /home ext4 relatime 0 2
# swap was on /dev/sda8 during installation
UUID=c9bcea3f-1d09-4787-b95a-730664fdf7a7 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/sda1 /media/windows ntfs-3g defaults,force 0 0
/dev/sda6 /media/media ntfs-3g defaults,force 0 0
/dev/sda7 /media/download ntfs-3g defaults,force 0 0
saravanan@saravanan-desktop:~$
5. You can either reboot the system to check that the partitions are getting properly mounted (OR) You can mount the partitions using 'sudo mount -a' command
Note: The 'force' option in the fstab file is used to force mount the partitions in case of unclean shutdown. Normally if there was a unclean shutdown, the ntfs partitions will not be automatically mounted during the bootup. To avoid this, the 'force' option is added.
Saturday, May 2, 2009
How to make USB storage device to get detected while booting ?
1. add the word "usb_storage" to the end of the file "/etc/modules"
2. save the file and reboot
3. usb storage devices are loaded at boot time
saravanan@saravanan-desktop:~$ sudo cat /etc/modules
[sudo] password for saravanan:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
lp
rtc
usb_storage
saravanan@saravanan-desktop:~$
2. save the file and reboot
3. usb storage devices are loaded at boot time
saravanan@saravanan-desktop:~$ sudo cat /etc/modules
[sudo] password for saravanan:
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
lp
rtc
usb_storage
saravanan@saravanan-desktop:~$
Sunday, January 25, 2009
Subscribe to:
Posts (Atom)