Results 1 to 6 of 6

Thread: Troubleshooting - Internet/Network Access

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Troubleshooting - Internet/Network Access

    Table of Contents
    Stage 1. - Check IP address (ifconfig)
    Stage 2. - Check gateway (route -n)
    Stage 3. - Check DNS (cat /etc/resolv.conf)
    Stage 4. - Check network connectivity (ping google.com -c 4; traceroute google.com; curl ifconfig.me)
    Stage 5. - *Optional* Check proxy settings (echo $http_proxy)
    Stage 6. - *Optional* Check virtual machine network adapter (NAT? Bridged?)


    Code:
    ifconfig; route -n; cat /etc/resolv.conf; ping google.com -c 4; traceroute google.com; curl ifconfig.me; echo $http_proxy

    For basic networking commands, please see this post: https://forums.kali.org/showthread.p...ll=1#post32652




    Stage 1. - IP address
    To check our current IP address, we can use ifconfig. (or 'ip a' / 'ip link')
    Note: you may want to use the '-a' flag (ifconfig -a) to show all NICs (including the ones that are down). For more information, see here.
    Code:
    root@kali ~$ ifconfig eth0
    eth0      Link encap:Ethernet  HWaddr 00:0b:29:9b:c9:a3  
              inet addr:192.168.1.48  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe81::21c:29aa:fe9c:b9a3/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:293492 errors:0 dropped:0 overruns:0 frame:0
              TX packets:135760 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:431811848 (411.8 MiB)  TX bytes:7409937 (7.0 MiB)
              Interrupt:19 Base address:0x2000 
    
    root@kali ~$

    DHCP vs Static IP
    DHCP
    If there is a DHCP service running on the network, you will automatically be assigned a free available IP address from its IP pool. Depending on its configuration, you may also be assigned a gateway and/or DNS addresses too.

    To obtain an IP address from the DHCP service from eth0 (default wired NIC), we can do the following:
    Code:
    root@kali ~$ dhclient eth0
    root@kali ~$

    Static
    If you wish to manually control your IP address, we are able to use 'ifconfig' again to alter our IP address (and subnet).

    In this example we will alter it to '192.168.0.10', and then to '192.168.1.25' (with a /24 subnet).
    Note: This guide only covers IPv4. IPv6 is out of scope.
    Code:
    root@kali ~$ ifconfig eth0 192.168.0.10
    root@kali ~$ ifconfig eth0 192.168.1.25/24
    root@kali ~$ ifconfig eth0
    eth0      Link encap:Ethernet  HWaddr 00:0c:29:9c:b9:a3  
              inet addr:192.168.1.25  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::20c:29ff:fe9c:b9a3/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:294583 errors:0 dropped:0 overruns:0 frame:0
              TX packets:135793 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:431879127 (411.8 MiB)  TX bytes:7413464 (7.0 MiB)
              Interrupt:19 Base address:0x2000 
    
    root@kali ~$

    In both of the examples above (DHCP & static), these configurations are not persistent and may not be the same upon a restart.
    To change this, we can alter the '/etc/network/interfaces' file.
    First, lets create a backup.
    Code:
    root@kali ~$ cp -f /etc/network/interfaces{,.bak}
    root@kali ~$
    Afterwards you can use your favourite text editor (vim, emacs, nano... gedit, geany, leafpad) to alter the file.
    Code:
    root@kali ~$ vim /etc/network/interfaces
    If you want to use get an IP address from the DHCP on 'eth0', then correct the file to look like:
    auto eth0
    iface eth0 inet dhcp
    ...But if you would like for 'eth0' to use an static IP (and set the subnet to /24 & gateway to 192.168.1.1), then change the file to match:
    iface eth0 inet static
    address 192.168.1.25
    netmask 255.255.255.0
    gateway 192.168.1.1
    Last edited by g0tmi1k; 2014-03-27 at 16:07.
    This is a Kali-Linux support forum - not general IT/infosec help.

    Useful Commands: OS, Networking, Hardware, Wi-Fi
    Troubleshooting: Kali-Linux Installation, Repository, Wi-Fi Cards (Official Docs)
    Hardware: Recommended 802.11 Wireless Cards

    Documentation: http://docs.kali.org/ (Offline PDF version)
    Bugs Reporting & Tool Requests: https://bugs.kali.org/
    Kali Tool List, Versions & Man Pages: https://tools.kali.org/

Similar Threads

  1. Network/Internet access? troubleshooting
    By anonymousb.i.g.986 in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2021-03-16, 04:16
  2. Network Manager not starting nor is it allowing internet access
    By Ezekiel1986 in forum TroubleShooting Archive
    Replies: 2
    Last Post: 2017-10-03, 14:43
  3. Network Access Yet No Internet Access {Desperate Mode}
    By eurovpn in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2014-11-19, 20:35
  4. Kali VM cannot access internet when it joins a local network
    By Soso in forum TroubleShooting Archive
    Replies: 2
    Last Post: 2014-08-14, 17:30

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •