Routing Table

Routing Table

To display the routing table in numerical addresses, one would use the “route -n” command:

$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.2.0 0.0.0.0 255.255.255.0 U 1 0 0 eth0

With iproute, the equivalent command is “ip route show”:

$ ip route show
10.0.2.0/24 dev eth0 proto kernel scope link src 10.0.2.15 metric 1
default via 10.0.2.2 dev eth0 proto static

Add or delete static routes from the Linux IP routing table.

You need to know the network/subnet you wish to reach, also the interface you wish this route to be added to, i.e., which interface to use to reach the subnet.

How to reach another network, 10.20.30.0/24, that is reachable via a router on the 192.168.1.0/24 network, 192.168.1.254.

The following ip route command would add the desired route to the kernel routing table:

ip route add 10.20.30.0/24 via 192.168.1.254 dev eth1

Note: eth1 is connected to 192.168.1.0/24

Determine which network interface card (NIC)Postfix is running on?

The netstat command allows querying of IP addresses and interfaces that the Postfix daemon is listening. By default, Postfix listens on TCP port 25.

By using the netstat and grep commands for port 25, IP addresses that Postfix are listening to can be found by issuing the following command:

netstat -an | grep :25 | grep tcp

Example:

$ netstat -an | grep :25 | grep tcp
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN

Here, Postfix is only listening on the IP address 127.0.0.1.

In order to list each interface’s assigned IP address, issue the following command as root:

ifconfig -a

How can I get access to a Windows file system

By default, Linux supports direct read/write access to FAT16 and FAT32 file system that Microsoft Windows uses, but not to an NTFS file system.

To access an NTFS file system on Linux.

Install a third party software named kernel-module-ntfs. We can get the rpm package from
http://sourceforge.net/projects/linux-ntfs/files

The kernel-ntfs kernel module will be load automatically by default when server reboot next time. Then you can mount your ntfs file system manually. We can load the kernel module by modprobe and use lsmod to confirm it’s installed

modprobe kernel-ntfs
lsmod | grep ntfs

Install a third party software named ntfs-3g and fuse.

Please access http://www.tuxera.com/community/ntfs-3g-download/ to get ntfs-3g and fuse.

NTFS-3G is a stable, read/write NTFS driver for Linux, Mac OS X, FreeBSD, NetBSD, OpenSolaris, QNX, Haiku, and other operating systems. It provides safe handling of the Windows XP, Windows Server 2003, Windows 2000, Windows Vista, Windows Server 2008 and Windows 7 NTFS file systems.

After successfully install, you can run command such as:

mount -t ntfs-3g /dev/sda2 /mnt

The /etc/modules.conf file

modules.conf - configuration file for loading kernel modules

The configuration file consists of a set of lines.
All empty lines, and all text on a line after a ‘#’, will be ignored.
Lines may be continued by ending the line with a ‘\’.

Example:

alias eth0 e1000

Driver for the Intel/Pro 1000 Network card which uses the e1000 driver.

The /etc/modules.conf file should only be modified if the system requires a driver that will be loaded during the boot sequence. The behavior of modprobe(8) (and depmod(8) ) can be modified by the (optional) configuration file /etc/modules.conf.

« Prev - Next »