g0tmi1k
2014-03-26, 11:39
Table of Contents
Stage 1 (https://forums.kali.org/showthread.php?20846-Troubleshooting-Internet-Network-Access&p=32766&viewfull=1#post32766). - Check IP address (ifconfig)
Stage 2 (https://forums.kali.org/showthread.php?20846-Troubleshooting-Internet-Network-Access&p=32787&viewfull=1#post32787). - Check gateway (route -n)
Stage 3 (https://forums.kali.org/showthread.php?20846-Troubleshooting-Internet-Network-Access&p=32788&viewfull=1#post32788). - Check DNS (cat /etc/resolv.conf)
Stage 4 (https://forums.kali.org/showthread.php?20846-Troubleshooting-Internet-Network-Access&p=32789&viewfull=1#post32789). - Check network connectivity (ping google.com -c 4; traceroute google.com; curl ifconfig.me)
Stage 5 (https://forums.kali.org/showthread.php?20846-Troubleshooting-Internet-Network-Access&p=32793&viewfull=1#post32793). - *Optional* Check proxy settings (echo $http_proxy)
Stage 6 (https://forums.kali.org/showthread.php?20846-Troubleshooting-Internet-Network-Access&p=32794&viewfull=1#post32794). - *Optional* Check virtual machine network adapter (NAT? Bridged?)
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.php?20807-Basic-Commands&p=32652&viewfull=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 (https://forums.kali.org/showthread.php?20807-Basic-Commands&p=32652&viewfull=1#post32652).
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:
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.
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.
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.
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
Stage 1 (https://forums.kali.org/showthread.php?20846-Troubleshooting-Internet-Network-Access&p=32766&viewfull=1#post32766). - Check IP address (ifconfig)
Stage 2 (https://forums.kali.org/showthread.php?20846-Troubleshooting-Internet-Network-Access&p=32787&viewfull=1#post32787). - Check gateway (route -n)
Stage 3 (https://forums.kali.org/showthread.php?20846-Troubleshooting-Internet-Network-Access&p=32788&viewfull=1#post32788). - Check DNS (cat /etc/resolv.conf)
Stage 4 (https://forums.kali.org/showthread.php?20846-Troubleshooting-Internet-Network-Access&p=32789&viewfull=1#post32789). - Check network connectivity (ping google.com -c 4; traceroute google.com; curl ifconfig.me)
Stage 5 (https://forums.kali.org/showthread.php?20846-Troubleshooting-Internet-Network-Access&p=32793&viewfull=1#post32793). - *Optional* Check proxy settings (echo $http_proxy)
Stage 6 (https://forums.kali.org/showthread.php?20846-Troubleshooting-Internet-Network-Access&p=32794&viewfull=1#post32794). - *Optional* Check virtual machine network adapter (NAT? Bridged?)
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.php?20807-Basic-Commands&p=32652&viewfull=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 (https://forums.kali.org/showthread.php?20807-Basic-Commands&p=32652&viewfull=1#post32652).
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:
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.
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.
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.
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