Friday, December 12, 2014

HowTo Red Hat Enterprise Linux 5 Configure The Network Card

HowTo Red Hat Enterprise Linux 5 Configure The Network Card


Red hat Enterprise Linux version 5.x and 4.x provides the following tools to make changes to network configuration such as add new card, assign/change IP address/subnet/gateway, and change DNS server and more.

[a] GUI tool - system-config-network
[b] Command line text based GUI tool (No X Windows/Gnome/KDE required) - system-config-network
[c] Edit configuration files stored in/etc/sysconfig/network-scripts/ directory. This method works with remote server over the ssh based session.
The following instructions are tested and compatible with:
  1. Cent OS Linux v3/4/5.x.
  2. Fedora Core Linux (older version).
  3. Red Hat Enterprise Linux (RHEL) v3/4/5.x based server.
Method # 1: GUI tool system-config-network
Open the X terminal or login using ssh over X based session command (ssh -X user@server-name-here). Type the following command at shell prompt:
Warning: It is important that you configure network interface cards correctly over ssh -X based session; otherwise, you will be locked out due to wrong network configuration.
$ system-config-network &
Sample outputs:
Fig.01: Configuring the RHEL/CentOS server network card using GUI tool
Fig.01: Configuring the RHEL/CentOS server network card using GUI tool
You will see a Window as above. Next, select your Ethernet card (such as eth0 or eth1) and click on the Edit button. You can now setup/modify IP address, netmask, default gateway and other properties. Here is an example from my personal RHEL 5.x server:
Fig.02: Setting or modifying IPv4 and IPv6 properties on RHEL/CentOS based server
Fig.02: Setting or modifying IPv4 and IPv6 properties on RHEL/CentOS based server
You can obtain IP address using DHCP or setup manually. Once IP address assigned, click onOk button to save the changes. You can activate card by clicking on Activate button.

Method # 2: Command line tool system-config-network-tui

If you don't have X windows GUI (gnome/kde desktop) installed on RHEL/CentOS/Fedora based system, than type the following command at shell prompt (this method also works on remote server using ssh based session):
Warning: It is important that you configure network interface cards correctly over ssh based session; otherwise, you will be locked out due to wrong network configuration.
# system-config-network-tui &
Sample outputs:
Fig.03: RHEL/CentOS command line network config tool (click to large)
Fig.03: RHEL/CentOS command line network config tool (click to large)
Select your Ethernet card such as eth0 or eth1 and hit [Enter] or [F12] special key to configure IP properties for selected NIC:
Fig.04: Setting up IPv4 properties on RHEL/CentOS (click to large)
Fig.04: Setting up IPv4 properties on RHEL/CentOS (click to large)
You can obtain an IP address using DHCP or setup IP address manually. Once an IP address assigned, click on the Ok button to save the changes.

Method #3: Edit configuration files stored in/etc/sysconfig/network-scripts/ directory

You can configure network card by editing text files stored in /etc/sysconfig/network-scripts/ directory. Open the terminal or login using ssh. Next, change directory to /etc/sysconfig/network-scripts/:
# cd /etc/sysconfig/network-scripts/
You need to edit / create files as follows using a text editor such as vi:
  • /etc/sysconfig/network-scripts/ifcfg-eth0 : First Ethernet card configuration file.
  • /etc/sysconfig/network-scripts/ifcfg-eth1 : Second Ethernet card configuration file.

Examples: Edit eth0 configuration file

To edit/create first NIC file, type the following command in /etc/sysconfig/network-scripts/ directory:
Warning: It is important that you configure network interface cards correctly over ssh based session; otherwise, you will be locked out due to wrong network configuration.
# vi ifcfg-eth0
OR
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
Edit or modify as follows for static ip configuration:
# eth0 - Intel Corporation 82573E Gigabit Ethernet Controller (Copper) on server1.cyberciti.biz by nixCraft on 10/4/2007
DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:30:48:56:A6:2E
IPADDR=10.10.29.66
NETMASK=255.255.255.192
ONBOOT=yes
 
Save and close the file.

Setting up default gateway and server (host) name

You need to define a default gateway (router IP) and hostname in /etc/sysconfig/network file. Edit /etc/sysconfig/network, enter:
# vi /etc/sysconfig/network
Append or modify configuration as follows:
NETWORKING=yes
HOSTNAME=www1.nixcraft.in
GATEWAY=10.10.29.65
 
Save and close the file. Finally, you need to restart the network service, run:
# /etc/init.d/network restart
OR
# /sbin/service network restart

Setting up dns server

Make sure you have correct DNS server defined in /etc/resolv.conf file:
# vi /etc/resolv.conf
Setup DNS server IP address as follows (feel free to replace 10.0.80.11, 10.0.80.12 as per your setup):
nameserver 10.0.80.11
nameserver 10.0.80.12
nameserver 202.67.222.222

Save and close the file. Now you can ping the gateway/other hosts using the ping command:
$ ping 10.0.80.12
Sample outputs:
PING 10.0.80.12 (10.0.80.12) 56(84) bytes of data.
64 bytes from 10.0.80.12: icmp_seq=1 ttl=251 time=0.972 ms
64 bytes from 10.0.80.12: icmp_seq=2 ttl=251 time=1.11 ms
You can also check for Internet connectivity with the ping, nslookup and/or host command:
$ nslookup cyberciti.biz
Sample outputs:
Server:         10.0.80.11
Address:        10.0.80.11#53
Non-authoritative answer:
Name:   cyberciti.biz
Address: 75.126.43.232
You can also use host dns lookup command as follows:
$ host nixcraft.in
Sample outputs:
nixcraft.in has address 75.126.43.232
nixcraft.in mail is handled by 10 mail.nixcraft.in.

How do I see or debug network configuration on RHEL/CentOS based server?

Simply use any one of the following commands:
 
###########################
## display ip config     ##
###########################
ifconfig
ifconfig -a | more
ifconfig eth0
ifconfig eth1
ip link
ip addr
 
###########################
## display routing table ##
###########################
route
route -nr
route -nr|more
ip route
 
###########################
## display dns config    ##
###########################
cat /etc/resolv.conf
 
###########################
## display firewall config#
###########################
iptables -L -n -v | more
cat /etc/sysconfig/iptables
 
###########################
## Debug network issues   #
###########################
ping host-name-here
ping ip-addeess-here
host ip-address-here
host domain-name-here
traceroute host-name-here
mtr host-name-here
dmesg | grep eth
lspci  | grep -i eth

Monday, December 8, 2014

5 Ways to Write Better Blog Posts



 
Kid on computer with glasses
Successful blogging drives qualified traffic to your website and helps establish you as an expert authority on subjects that are important to your clients. However, most blogs run into problems with a high bounce rates, meaning people that visit immediately leave, or that visitors aren’t converting into subscribers, leads or customers.

These problems can be alleviated with some simple modifications to your blog posts that will make them more inviting for both new and returning visitors.

1. Write About Topics Relevant to Your Audience  

When you brainstorm your upcoming blog post topics make sure you cater to the needs of your audience first. You’re an expert in all things related to your business, so think about some of the most frequently asked questions you’ve received in the past couple weeks. You can answer those with “how to” blog posts. These types of blog posts are going to be extremely relevant to your audience, and relevancy equates to engagement, meaning the more relevant the content is, the more likely a visitor will read the entire article and end up completing a desired action when they’re done; sharing, commenting, signing up, purchasing.

You can also invite relevant co-marketing partners to publish guest posts, bringing new opinions, insights, and audiences into play.

Don’t make your blog posts extremely self-promotional. Instead, focus on providing something unique and valuable to your audience.

2. Use Engaging Headlines

You need to make sure that your headlines grab attention. Readers make a split-second decision to either keep reading or leave when they see your headline, so it’s important that you hook them early.

I like to use the 4 U’s when formatting headlines:

  1. Be USEFUL to the reader
  2. Provide the reader with a sense of URGENCY
  3. Show that the main benefit is UNIQUE
  4. Do all of the above in an ULTRA-SPECIFIC way


3. Use Proper Formatting 

When it comes to content format and structure, your readers should be able to quickly skim your article and still leave with a key takeaway.

Here are some formatting tips for you to use in your blog posts:

  • Write in essay format with an intro, explanation of major points, conclusion and call-to-action
  • Keep your paragraphs short. Five sentences is too long. Two to three is ideal.
  • Use bold and italics to emphasize key points and encourage tone inflection.
  • Use bullets and numbered lists when applicable.
  • Separate out sections and start each one with relevant subheadlines. 
  • Use headline colors that are easy on the eyes.
  • Use whitespace intelligently. It improves overall legibility.

Review your blog post when you’re done and ask yourself, “Is this easy to quickly read/review?” That will give you a clear indication on whether or not it’s properly formatted.

4. Use High-Quality Imagery

Interesting imagery is a great way to attract more visitors, especially when used with social media posts.

If you don’t take your own pictures you can usually find relevant images from Creative Commons, just be sure to follow the proper licensing and author reference guidelines. Infographics are great too, here are 10 free tools you can use to create your own.

5. Keep The Right Length

When it comes to making your posts more inviting, I tend to side with shorter is better. Most readers prefer easily digestible content and don’t have a lot of time for reading super long blog posts.

I’m not suggesting making your blog posts just a couple sentences, they should still contain some substance. My general rule of thumb is to use as few words as possible to get the point across. When you’re done writing and proof-reading your post, time yourself reading through your article. If it takes longer than five minutes, consider removing some text.



Start implementing these tips today to make your blog posts as inviting as possible and you’ll see your average duration on site go up and your bounce rate go down, resulting in more traffic and customers for your business!