Managing and using network connectivity on a unix system

learn more… | top users | synonyms (1)

76
votes
3answers
46k views

How does reverse SSH tunneling work?

As I understand this, firewalls (assuming default settings) deny all incoming traffic that has no prior corresponding outgoing traffic. Based on Reversing an ssh connection and SSH Tunneling Made ...
50
votes
2answers
6k views

How does SSH connection survive a network restart?

From a Linux SSH shell, type /etc/init.d/network restart to restart the network service. I expect my SSH connection to die since the network service goes down. But it doesn't. Very cool. But how does ...
38
votes
7answers
53k views

What DNS servers am I using?

How can I check which DNS server am I using (in Linux)? I am using network manager and a wired connection to my university's LAN. (I am trying to find out why my domain doesn't get resolved)
35
votes
3answers
62k views

How to make a machine accessible from the LAN using its hostname

Here are details of the machine I want to access using its hostname: $ hostname hostname $ cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 hostname.company.local hostname It's a default Debian 6 ...
32
votes
4answers
16k views

Throttle the download speed of wget or curl while downloading

Is it possible to throttle (limit) the download speed of wget or curl ? Is it possible to change the throttle value while it is downloading ?
30
votes
6answers
54k views

Determining what process is bound to a port

I know that using the command: lsof -i TCP (or some variant of parameters with lsof) I can determine which process is bound to a particular port. This is useful say if I'm trying to start ...
29
votes
3answers
5k views

Can TCP provide more than 65535 ports?

Is it possible to setup a Linux system so that it provides more than 65,535 ports? The intent would be to have more than 65k daemons listening on a given system. Clearly there are ports being used ...
29
votes
7answers
7k views

Block network access of a process?

Is it possible to block the (outgoing) network access of a single process?
28
votes
10answers
57k views

Streaming to an Apple TV (3) from Linux

Alright, here is the setup: One apple tv 3 in the living room, connected to the network (wired). One pc running Linux (Arch Linux x64, AMD), containing all music, movies and series (wired). Now I ...
26
votes
5answers
21k views

On-the-fly monitoring HTTP requests on a network interface?

For debugging purposes I want to monitor the http requests on a network interface. Using a naive tcpdump command line I get too much low-level information and the information I need is not very ...
25
votes
6answers
29k views

Linux: allowing an user to listen to a port below 1024

I need to allow an user (different from root) to run a server listening on port 80. Is there any way to do this?
25
votes
1answer
751 views

Why does it take up to several minutes to clean a listening TCP port after a program dies?

If I kill a program that is listening on a TCP port, it takes up to several minutes until the port is reclaimed by the system and usable again. I've seen several Q/A mentioning this phenomenon, but ...
24
votes
1answer
13k views

Why are the first 1024 ports restricted to the root user only?

This is more idle curiosity than anything else. A friend of mine asked me 'which port range is it that only root can use under Linux?' I told him 0-1024 were restricted. Then he asked my why it was so ...
23
votes
6answers
45k views

How to limit network bandwidth?

Problem: We are hosting an application on remote server. We need to test it with a limited network bandwidth (for users with bad Internet access). Question: Can I limit my internet bandwidth (in ...
23
votes
4answers
18k views

How to speed up X over SSH on a slow network connection?

Are there any specific recommendations on speeding up X applications over ssh on a slow network connection? In this specific case, I am accessing a server located in west coast from a laptop in east ...
21
votes
2answers
17k views

how to check rx ring, max_backlog, and max_syn_backlog size

Quite often in the course of troubleshooting and tuning things I find myself thinking about the following Linux kernel settings: net.core.netdev_max_backlog net.ipv4.tcp_max_syn_backlog ...
20
votes
9answers
22k views

How to get my own IP address and save it to a variable in a shell script?

How can I get my own IP address and save it to a variable in a shell script?
20
votes
5answers
8k views

What is the need for rsync server in daemon mode

I don't understand the need for an rsync server in daemon mode. What are the benefits from it if I can use rsync with SSH or telnet?
19
votes
5answers
5k views

What is a socket?

Could someone explain to me what a socket is? I see it in many acronyms in context of SSL, etc. Also, why is it called a socket? Is it purely because it was what a name they invented? Or was it the ...
19
votes
5answers
18k views

How can I limit the bandwidth used by a process?

I have a CentOS 5.7 server that will be backing up its files nightly. I am concerned that visitors to the various sites that the server hosts will experience degraded performance while the backup is ...
19
votes
2answers
2k views

Is it possible to connect to TCP port 0?

Listening to TCP port 0 allocates me a free port number on the system. But what happens when I try to connect to TCP port 0? The obvious answer is: "It doesn't work": $ nc localhost 0 ...
18
votes
4answers
59k views

Why the default eth0 interface is down by default on CentOS?

I am already a little bit familiar with Linux distros like Debian or Ubuntu (yeah, very similar) but I wanted to try Red Hat based - CentOS 6.2 . I have installed it on my Windows 7 host in virtualBox ...
18
votes
7answers
2k views

Why compute checksums of downloaded files?

I often see a checksum given next to a file available for download. The purpose of this practice eludes me. It is obviously to detect corrupt files, but what could be the cause of this corruption and ...
17
votes
3answers
38k views

Can't ifdown eth0 (main interface)

I can't ifdown an interface on a Debian 6.0.5 box; user@box:/etc/network$ sudo ifdown eth0 && sudo ifup eth0 ifdown: interface eth0 not configured SIOCADDRT: File exists Failed to bring up ...
17
votes
1answer
37k views

Using ip addr instead of ifconfig reports “RTNETLINK answers: File exists” on Debian

I have a Debian system working as a wireless router with eth0 and wlan0. Now I added an additional network manually on eth1 with ifconfig: alix:~# ifconfig eth1 192.168.0.2 netmask 255.255.255.0 ...
17
votes
2answers
5k views

Is there an easy way to programmatically extract IP address?

Is there an easy way to programmatically extract IP address, without tedious parsing of ifconfig? I would not mind simple command output processing using sed to do it but not processing multiline ...
17
votes
3answers
782 views

Limiting a specific shell's internet bandwidth usage

I want update my linux in one shell but by default wget or axel in updater use all the bandwidth. How can I limit the speed in this shell? I want other shells to have a fair share, and to limit ...
17
votes
6answers
25k views

CentOS no network interface after installation in VirtualBox

I have Ubuntu 12.10 on which i installed virtual box on which I setup centos 6.4 i386. On Ubuntu I have: 3.5.0-17-generic kernal running. On virtual box I install centos 6.4 and everything works ...
16
votes
3answers
3k views

Why are TCP/IP sockets considered “open files”?

I need some assistance grasping what I'm sure is a fundamental concept in Linux: the limit for open files. Specifically, I'm confused on why open sockets can count towards the total number of "open ...
16
votes
2answers
34k views

How can I find available network interfaces?

This is in regard to linux, but if anyone knows of a general *nix method that would be good. I booted a system yesterday with an ethernet cable plugged in. "NetworkManager" is not installed, so once ...
16
votes
3answers
19k views

Linux network troubleshooting and debugging

From time to time Linux and Unix users faced with various network problems. Many of these problems are presented here and at some others troubleshooting forums, but the are very concrete and contains ...
16
votes
5answers
13k views

Sending audio through network

This is a rather crazy idea. I am planing to set up a configuration that would send audio being played on my laptop to my home server via local network so that the sound is played on the server ...
16
votes
4answers
62k views

Connecting to wifi network through command line

I am trying to connect to my WEP network just using the command-line (Linux). I run: sudo iwconfig wlan0 mode Managed essid 'my_network' key 'xx:xx:... hex key, 26 digits' Then I try to obtain an ...
16
votes
4answers
21k views

Can I create a virtual ethernet interface named eth0?

I am running Arch based on the Linux 3.10.5-1 kernel. The system uses the new de-facto naming conventions of ethernet interfaces enp*s* and wlp* etc. This is a problem however, as my educational ...
16
votes
2answers
54k views

Orphaned connections in CLOSE_WAIT state

I've got a SLES machine that accumulates TCP connections in a CLOSE_WAIT state for what appears to be forever. These descriptors eventually suck up all available memory. At the moment, I've got 3037 ...
15
votes
9answers
1k views

Simple file transfer

Given two Linux boxes on a LAN, what's the simplest way to transfer files between them?
15
votes
6answers
5k views

What is using this network socket?

I'm trying to use NTP to update the time on my machine. However, it gives me an error: host # ntpdate ntp1.example.org 10 Aug 12:38:50 ntpdate[7696]: the NTP socket is in use, exiting What does the ...
15
votes
11answers
64k views

Cannot enable network after CentOS 6.3 fresh install

I am trying to perform a fresh CentOS 6.3 installation then run various yum commands such as yum install httpd. The installation runs fine, however I cannot run any network based commands like yum I ...
15
votes
3answers
17k views

How to find what other machines are connected to the local network

How can I see a list of all machines that are available on the LAN I'm am part of.
15
votes
7answers
12k views

Faster way than ping for checking if computer online?

I'm writing a wake on lan script for a set of our lab computers. We have sqlite db with a list of the computer hostnames, IPs, and MACs and currently I ping each of them with '-c1' so it doesn't run ...
15
votes
3answers
30k views

CentOS eth0 not starting

Why would my new CentOS Virtual Machine not start eth0 on startup? I have to start it manually every time. How can I fix this? Thanks.
15
votes
6answers
48k views

How to change the order of the network cards (eth1 <-> eth0) on linux

Is there any way to swap network interfaces (eth1 <-> eth0) after system installation. My brand new Debian 6.0 install assigned PCI network card as "eth0" and motherboards integrated network ...
15
votes
1answer
1k views

“ss” command in iproute package; why query slab table for timewait sockets?

Forgive me if this isn't the best forum for this question, but it seems more relevant to the kernel than to the programming itself. I'm writing a script that queries the system for open ports so that ...
14
votes
3answers
14k views

Does mount always require root privileges?

I was under the impression that any sort of call to mount requires root privileges. But recently I was told "You should instead create appropriate entries in /etc/fstab so that the filesystems can be ...
14
votes
3answers
29k views

VirtualBox: two network interfaces (NAT and host-only ones) in a Debian guest on Ubuntu

I created a Debian VM on VirtualBox with two interfaces: a NAT one (for accessing internet) and a host-only one. However, I do not know how to make both interfaces work at the same time. If I the ...
14
votes
1answer
30k views

FreeBSD: How to fix “ping: sendto: No buffer space available”?

I'm trying to ping a remote host, but I get an error. # ping 192.168.80.1 PING 192.168.80.1 (192.168.80.1): 56 data bytes ping: sendto: No buffer space available ping: sendto: No buffer space ...
14
votes
4answers
1k views

TCP dies on a Linux laptop

Once in several days I have the following problem. My laptop (Debian testing) suddenly becomes unable to work with TCP connections to the internet. The following things continue working fine: UDP ...
13
votes
4answers
2k views

How am I supposed to edit files on a network with Vim?

Currently I'm doing it by SSHing into a server, and executing Vim on the server. This has the benefit of not having to deal with cumbersome syntax of opening files from a remote server over SCP, and, ...
13
votes
8answers
6k views

What are some common tools for intrusion detection? [closed]

Please give a brief description for each tool.
13
votes
2answers
5k views

How can I create a virtual ethernet interface on a machine without a physical adapter?

I have a Dell XPS 13 ultrabook which has a wifi nic, but no physical ethernet nic (wlan0, but no eth0). I need to create a virtual adapter for using Vagrant with NFS, but am finding that the typical ...