Žilinská univerzita > Fakulta riadenia a informatiky > Katedra informačných sietí

Linux - HOWTO

LPIC-2 Exam Prep

Nice book on LPIC-2 exam preparation (Linux Professionals)

web: http://lpic2.unix.nl/

Keywords: lpic, lpi, linux, certification

Finding forgotten MikroTIK password using MKBrutus (on Kali Linux)

Using tcpdump for diagnostic of DNS - debian

TCPdump is a powerful command-line packet analyzer, which may be used for analyzing of DNS question/answer process. TCPdump is preinstalled on many linux distributions. For debian it can be installed directly from the debian repository:

apt-get install tcpdump

TCPdump allows write a sniff to file or display it realtime. It provides several ways how to use it for DNS analysis. Now I will write a few examples. Deeper description is at the bottom of the page.

 

Example 1) Capture DNS on the fly:

Creating a network bridge in linux

The creation of network bridge among two PC's networking cards in linux consist from a few following steps:

Prepare your interfaces:

ifconfig eth0 down
ifconfig eth1 down
ifconfig eth0 0.0.0.0 up
ifconfig eth1 0.0.0.0 up

Create a bridge

brctl addbr br0

Connect network interface cards to the bridge

brctl addif br0 eth0
brctl addif br0 eth1

Turn on IPv4 routing

echo "1" > /proc/sys/net/ipv4/ip_forward

Turn off Spanning Tree protocol

Parsing BGP packets using tcpdump

We should use tcpdump tool to read BGP routing messages, of course, several ways are available.

Capturing BGP packets on the fly

tcpdump -i eth0 tcp proto 179

where BGP ip protocol number is 89, and the protocol field is the 9th octet on the ip header.

Parsing OSPF packets using tcpdump

Sometimes we need to capture and parse OSPF packets for next analysis and we have a comand line only, in my case on linux server with dynamips. We should use tcpdump tool for this purpose, of course, several ways are available.

Capturing OSPF packets on the fly

tcpdump -i eth0 ip[9] == 89

where OSPF ip protocol number is 89, and the protocol field is the 9th octet on the ip header.

Another way is:

tcpdump -i eth0 proto ospf

Writing captured packets to a file

Kamailio configuration to provide load balancing and failover for media services

In many setups Kamailio is used as a PROXY server that takes care of routing calls to servers providing voice services, e.g. voicemail, IVR or conference calls.

There are a few things an administrator must keep in mind.

Kamailio Call establishment permission rules

This article talks about deploying permission control mechanism for call establishment in Kamailio SIP Proxy.

In many VoIP solutions, it is crutial to deploy numbering scheme and write down rules where users are/aren't allowed to call.
On top of that, a company can allow the people to call outside, for example to PSTN. The rules can change over time as well as the numbering scheme itself.



Setting an IP address using the ip linux command


1) First, we'll check our current status and linux names of interfaces

ip a

or

ip link

where commands lists our' machine network interfaces, for example:

 

2) Next, using the subcommand addr we will add an IP address with a proper nework mask length

ip addr add 192.168.1.10/24 dev [INTERFACE_NAME]

for example:

ip addr add 192.168.1.10/24 dev eth1

 

3) No we will add default gateway's IP address  for correct routing

Syndicate content