Hello Readers

0 comments




Hello dear readers,

First we would like to wish you all that happy VIJAYADASHAMI. From today onwards we would assure you that we will write posts frequently. Why we have selected this day because if we start whatever work on Vijayadashami, we will get success on that work. Once again Happy Vijayadashami to all.


Thanks.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • How To Assign Default Gateway In Linux?

    0 comments

    How to Assign Default gateway in linux?
    Ans : In linux Default gateway is set through route command or GUI tools.

    Through Route command
    #route add default gw default-gateway

    Example :
    #route add default gw 192.168.0.1
    Here 192.168.0.1 is the default gate of my system.

    Through GUI tools
    Use system-config-network in terminal or GUI to set up default gateway.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • How To View Default Gateway In Linux?

    0 comments

    This is asked in some of the interviews. We can get default gateway information in linux in many ways. Such as viewing network card file or executing a command.
    To see default gateway by view network interface card file content.
    #cat /etc/sysconfig/networking/devices/interface-no

    Example :
    [root@example ~]# cat /etc/sysconfig/networking/devices/ifcfg-eth0
    # Intel Corporation 82546EB Gigabit Ethernet Controller (Copper)
    DEVICE=eth0
    BOOTPROTO=none
    HWADDR=00:02:a5:4c:af:99
    ONBOOT=yes
    TYPE=Ethernet
    NETMASK=255.255.255.0
    IPADDR=10.200.0.21
    GATEWAY=10.200.0.1

    Through route command
    route

    Example:
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
    10.78.0.0 * 255.255.255.0 U 0 0 0 eth0
    169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
    default 10.200.0.1 0.0.0.0 UG 0 0 0 eth0

    Through ip route command
    ip route

    Example :
    [root@example ~]# ip route
    192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.1
    10.78.0.0/24 dev eth0 proto kernel scope link src 10.78.0.21
    169.254.0.0/16 dev eth1 scope link
    default via 10.200.0.1 dev eth0

    Through netstat command
    netstat -r

    Example:
    [root@example ~]# netstat -r

    Kernel IP routing table
    Destination Gateway Genmask Flags MSS Window irtt Iface
    192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
    10.78.0.0 * 255.255.255.0 U 0 0 0 eth0
    169.254.0.0 * 255.255.0.0 U 0 0 0 eth1
    default 10.200.0.1 0.0.0.0 UG 0 0 0 eth0

    Note:For any system/server there will be only one default gateway, if suppose if you assign two default gateways to your machine, your system will not come to know where to send the packets.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Archive

    Translate this page

     

    The Linux Juggernaut | Copyright 2006-2009 Surendra Kumar Anne | Surendra's Home Page | Give us feedback how we are doing, Click here