|
|
| (3 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| =Basic Networking= | | =Basic Networking= |
|
| |
|
| This page covers some basic troubleshooting for Linux networks. | | This page covers some basic troubleshooting for Linux networks. See [[Template:LinuxNetworkingFlag]] for more pages like this one. |
|
| |
|
| ==ping==
| | Linux network interfaces: [[Linux/Network Interfaces]] |
|
| |
|
| You managed to run ping. You have even figured out how to use the <code>-c</code> flag to ping a specific number of times. But if it doesn't work, then what?
| | Linux network services: [[Linux/Networking Services]] |
|
| |
|
| Start by checking your networking configuration.
| | =Open Ports= |
|
| |
|
| <pre>
| | List open ports: |
| /etc/network/interfaces
| |
| </pre>
| |
| | |
| do it
| |
|
| |
|
| <pre> | | <pre> |
| # vim /etc/network/interfaces
| | netstat -lntu |
| </pre> | | </pre> |
|
| |
|
| ==network device configuration== | | =Related= |
|
| |
|
| networking device configurations, if they exist, are located in
| | See [[Template:LinuxNetworkingFlag]] for more pages like this one. |
|
| |
|
| <code>/etc/network/interfaces</code>
| |
|
| |
| 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 <code>/etc/network/interfaces</code>
| |
|
| |
| barebones interfaces file:
| |
|
| |
| <pre>
| |
| $ cat /etc/network/interfaces
| |
|
| |
| # The loopback network interface
| |
| auto lo
| |
| iface lo inet loopback
| |
| </pre>
| |
|
| |
| check for network manager
| |
|
| |
| <pre>
| |
| $ ps ax | grep NetworkManager
| |
| </pre>
| |
|
| |
| ==option 1: no network manager==
| |
|
| |
| kill it! kill it!!!
| |
|
| |
| <pre>
| |
| 446 ? Ssl 0:00 /usr/sbin/NetworkManager --no-daemon
| |
| </pre>
| |
|
| |
| 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)
| |
|
| |
| <pre>
| |
| # The loopback network interface
| |
| auto lo
| |
| iface lo inet loopback
| |
|
| |
| # Wired connection eth0
| |
| auto eth0
| |
| iface eth0 inet dhcp
| |
| </pre>
| |
|
| |
| ===manual static===
| |
|
| |
| <pre>
| |
| # 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
| |
| </pre>
| |
|
| |
| the following line changed:
| |
|
| |
| <pre>
| |
| iface eth0 inet static
| |
| </pre>
| |
|
| |
| 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
| |
|
| |
| <pre>
| |
| $ systemctl restart networking.service
| |
| </pre>
| |
|
| |
| figure out what networking interfaces are available
| |
|
| |
| <pre>
| |
| $ ifconfig
| |
|
| |
| or
| |
|
| |
| $ ip addr show
| |
| </pre>
| |
|
| |
| ==option 2: with network manager==
| |
|
| |
| can check if network manager is running:
| |
|
| |
| <pre>
| |
| $ ps aux | grep Network
| |
| </pre>
| |
|
| |
| to configure network manager in a gui-like terminal environment:
| |
|
| |
| <pre>
| |
| $ nmtui
| |
| </pre>
| |
|
| |
| 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.
| |
|
| |
| =Related=
| |
|
| |
|
|
| |
|
|
| |
|
| {{LinuxNetworkFlag}} | | {{LinuxNetworkFlag}} |