Linux/Networking: Difference between revisions
From charlesreid1
No edit summary |
|||
| Line 146: | Line 146: | ||
{{KaliFlag}} | {{KaliFlag}} | ||
{{NetworkingFlag}} | {{NetworkingFlag}} | ||
{{LinuxNetworkFlag}} | |||
Revision as of 23:34, 13 March 2016
networking
ping
Okay, you have managed to run ping. You have even figured out how to use the -c flag. but if it doesn't work, then what?
check configuration.
/etc/network/interfaces
do it
# vim /etc/network/interfaces
network device configuration
networking device configurations, if they exist, are located in
/etc/network/interfaces
the file is not required for network hardware to work - it is optional. if nothing is set in the above file, network is probably being managed by network manager. system level daemon that makes things "just work".
desktops/laptops usually want network manager, servers/embedded computers/etc want stuff configured in /etc/network/interfaces
barebones interfaces file:
$ cat /etc/network/interfaces # The loopback network interface auto lo iface lo inet loopback
check for network manager
$ ps ax | grep NetworkManager
option 1: no network manager
kill it! kill it!!!
446 ? Ssl 0:00 /usr/sbin/NetworkManager --no-daemon
die die die - ok back to what we were doing.
automatic dhcp
if you want to add your ethernet hardware, and let it automatically request and receive an IP address from a DHCP server (this expects/requires the device to be plugged in to something running a DHCP server, like a router)
# The loopback network interface auto lo iface lo inet loopback # Wired connection eth0 auto eth0 iface eth0 inet dhcp
manual static
# The loopback network interface
auto lo
iface lo inet loopback
# Wired connection eth0
auto eth0
iface eth0 inet static
address 10.10.10.12
netmask 255.255.248.0
network 10.10.10.0
broadcast 10.10.10.255
gateway 10.10.10.1
the following line changed:
iface eth0 inet static
static, not dhcp
if you declare dhcp, all other configuration details ignored
next declare ip address, 10.10.10.12
declare subnet mask to 255.255.248.0
declare the network we're joining to 10.10.10.0
declare the broadcast ID as 10.10.10.255
decalre the gateway as 10.10.10.1
now restart networking service
$ systemctl restart networking.service
figure out what networking interfaces are available
$ ifconfig or $ ip addr show
option 2: with network manager
can check if network manager is running:
$ ps aux | grep Network
to configure network manager in a gui-like terminal environment:
$ nmtui
This allows you to connect to a wireless network and enter information into corresponding fields, or to set the details of a static IP address for your network for a particular device. When editing an ethernet connection (like the eth0 device) you will see an IPv4 configuration option. If you pick "Show," you can enter an IP address, a gateway, a DNS server, etc.
References
"Mastering Linux"
Related
| Networking pages and notes about computer networks.
Man in the Middle attack vectors on wired networks: Man in the Middle/Wired Packet analysis with Wireshark: Wireshark Packet Analysis Linux networking: Linux/Networking
Using Aircrack: Aircrack Many Ways to Crack a Wifi: Cracking Wifi
Linux/Networking · Linux/SSH · Linux/File Server
Notes on OpenVPN: OpenVPN Setting Up a Static Key VPN: OpenVPN/Static Key
Domain Name Servers: DNS · Linux/DNS IP Version 6: IPv6
Wireshark · SSH · Stunnel · Tor · Ettercap · Aircrack · Tcpdump
Tunnels · HTTP and HTTPS · SSH Tunnels · Linux/SSH
|
| linux networking all the pages for linux networking
Diagnosing network interfaces: Linux/Network Interfaces Connecting to nodes with ssh: Linux/SSH Bridging networks with ssh tunnels: Linux/SSH Linux file server nfs/smb/sshfs: Linux/File Server Samba on linux: Linux/Samba Automounting network shares on linux: Linux/Automount Network Shares Monitoring system resources: Linux/System Monitoring Linux systemd: Linux/Systemd
IP Schema (ipcalc): Linux/IP Schema DHCP Server: Linux/DHCP DNS Server: Linux/DNS NTP Server: Linux/NTP
|