Tag Info

Hot answers tagged

47

Looking at the RFC for TCP: RFC 793 - Transmission Control Protocol, the answer would seem to be no because of the fact that a TCP header is limited to 16-bits for the source/destination port field.      Does IPv6 improve things? No. Even though IPv6 will give us a much larger IP address space, 32-bit vs. 128-bits, it makes no attempt ...


24

Apart from not getting detailed information about your test setup the main problem seems to be, that you use a message size of 64 byte. This is far away from the usual MTU of 1500 bytes and makes UDP highly inefficient: while TCP merges multiple sends into a single packet on the wire (except if TCP_NODELAY is set) to make efficient use of the link, each UDP ...


19

The limit on "open files" is not really just for files. It's a limit on the number of kernel handles a single process can use at one time. Historically, the only thing that programs would typically open a lot of were files, so this became known as a limit on the number of open files. There is a limit to help prevent processes from say, opening a lot of files ...


18

From man 1 traceroute: -m max_ttl Specifies the maximum number of hops (max time-to-live value) traceroute will probe. The default is 30.


16

I have drawn some sketches The machine, where the ssh tunnel command is typed is called »your host«. Introduction local: -L Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. ssh -L sourcePort:forwardToHost:onPort connectToHost means: connect with ssh to connectToHost, and ...


15

Setting up a dummy interface If you want to create network interfaces, but lack a physical NIC to back it, you can use the dummy link type. You can read more about them here: iproute2 Wikipedia page. Creating eth10 To make this interface you'd first need to make sure that you have the dummy kernel module loaded. You can do this like so: $ sudo lsmod | ...


14

Sorry but I got it myself. I had to flush the device before bringing it up: alix:~# ip addr flush dev eth1


13

This is one of those things that surprises people because it goes against what they've been taught. 2 machines with the same hardware mac address on the same broadcast domain can talk to each other just fine as long as they have different IP addresses (and the switching gear plays nice). Lets start with a test setup: VM1 $ ip addr show dev enp0s8 3: ...


12

Special (and AFAICT) slightly under-documented behaviour in iputils ping: you ping yourself. If you ping 0 this is what happens (heavily edited and commented for clarity): if (inet_aton(target, &whereto.sin_addr)) == 1) { // convert string to binary in_addr } // inet_aton returns 1 (success) and leaves the `in_addr` contents all zero. if ...


12

Some (but not all) reasons: In order to host multiple SSL sites as already mentioned Because you may be consolidating services from multiple hosts and you need to preserve the addresses In order to use an IP address that can later be transferred to another host To compensate for a host that's down at that moment by adding its IP address to another one If ...


11

The kernel lists them by name in /sys, both separately in (e.g.) the tree of PCI devices -- although finding them there if you don't know where they are to start with is not simple -- and together via symlinks in /sys/class/net. E.g.: > ls /sys/class/net em1 lo wlp6so Another example: > ls /sys/class/net lo p6s1 wlan0 If you are not sure which is ...


10

In a screen or tmux session, set up a shell that will reverse your changes after a delay. I don't know anything about iptables, so can't help with that, but something like this has saved my proverbial bacon on numerous occasions while altering live firewall configs on FreeBSD: # In one `screen` or `tmux` window % sleep 60 && <command to reverse ...


10

The reason why TCP/IP sockets use file descriptors is that, when the sockets interface was first designed and implemented (in BSD Unix, in 1983), its designers felt that a network connection was analogous to a file - you can read, write, and close both, and that it would fit well with the Unix idea of "everything is a file". Other TCP/IP network stack ...


9

When some location is further than 30 hops, it probably means simply that last hops does not replies when TTL exceeds. Unless, it's a story: $ traceroute -m100 216.81.59.173 traceroute to 216.81.59.173 (216.81.59.173), 100 hops max, 52 byte packets (...) 14 episode.iv (206.214.251.1) 173.387 ms 171.638 ms 171.201 ms 15 a.new.hope (206.214.251.6) ...


8

That's how the ping command works. You can control it using the count switch, -c. Example $ ping -c 2 skinner PING skinner.bubba.net (192.168.1.3) 56(84) bytes of data. 64 bytes from skinner.bubba.net (192.168.1.3): icmp_req=1 ttl=64 time=1.00 ms 64 bytes from skinner.bubba.net (192.168.1.3): icmp_req=2 ttl=64 time=1.13 ms --- skinner.bubba.net ping ...


8

The only straightforward way I know of doing this is to use the wall command. This can be used to omit the sender's identification, via the -n switch. Example $ sudo wall -n hi Remote broadcast message (Fri Nov 8 13:49:18 2013): hi using echo This alternative method is more of a hack, since it isn't done through an explicit tool but you can echo text ...


8

Method #1 - from NetworkManager's Applet Try disabling the wireless networking under the Network Applet that's accessible from under the icons in the upper right of your desktop. ...


8

Look at the output of the last command and anything with an IP address or hostname instead of a blank space came in over the network. If sshd is the only way of doing that on this system, then there you go. Alternatively (if this is Linux), you can check /var/log/secure where sshd will usually keep track of connections made even if they don't result in ...


8

Yes it's entirely possible that your firewall is blocking the traceroute from being successful. To understand why this is failing it's best to consult the traceroute man page. excerpt This program attempts to trace the route an IP packet would follow to some internet host by launching probe packets with a small ttl (time to live) then listening for an ...


8

That's a change in how now udevd assigns names to ethernet devices. Now your devices use the "Predictable Interface Names", which are based on (and quoting the sources): firmware/bios-provided index numbers for on-board devices firmware-provided pci-express hotplug slot index number physical/geographical location of the hardware the interface's MAC address ...


7

The host command doesn't check the hosts file. From the manpage: host is a simple utility for performing DNS lookups. If you want to test lookups while respecting the hosts file, then use ping or getent. $ tail -1 /etc/hosts 127.0.0.1 google.com $ ping -c1 google.com | head -1 PING google.com (127.0.0.1) 56(84) bytes of data. $ getent ahosts ...


7

Each network adapter on linux has a sysctl boolean parameter accept_local (/proc/sys/net/ipv4/conf/eth0/accept_local). Try setting it to 0 for all adapters involved (additionally, you may need to modify your routing table to suit your test setup). Also, make sure that rp_filter (/proc/sys/net/ipv4/conf/eth0/rp_filter) is enabled (not 0). Reference: ...


7

There are a few ways. The modern way: use ip. ip -s link The output is pretty self-explanatory. The old way: use ifconfig. ifconfig -a Also self-explanatory, but not as trivial to parse. The /proc way: cat /proc/net/dev Look at the proc(5) man page for more information (there really isn't much). This is a bit hard for human eyes, but very easy to ...


7

The simplest method I know to list all of your interfaces is ifconfig -a EDIT If you're on a system where that has been made obsolete, you can use ip link show


7

Assuming I'm reading correctly, your problem isn't that you want to know how to change the IP address, it's that you want to prevent changing it to something that stops future access. This isn't necessarily a technical problem, it's a quality issue. However, you might try something like this (you'll need to work out how to achieve it in detail). Write a ...


7

You can use a modified version of this script to do what you want: #!/bin/bash downTime=0 lastAccessTime=$(date +"%s") while [ true ]; do if ! ping -c1 google.com >& /dev/null; then downTime=$(( $(date +"%s") - $lastAccessTime )) else downTime=0 lastAccessTime=$(date +"%s") fi sleep 15 if [ $downTime -ge 300 ]; then echo "alert" fi ...


7

Your path looks ok, but does not include /sbin, which may be intended. You were probably looking for the command /sbin/ifconfig. If this file does not exist (try ls /sbin/ifconfig), the command may just be not installed. It is part of the package net-tools, which is not installed by default, because it's deprecated and superseeded by the command ip ...


7

you want tcpdump not nc, and the syntax would be tcpdump -i eth0 netcat is only for basic TCP/IP testing. tcpdump utilizes the libpcap library which allows for lowlevel interactions with packets and the likes


6

You're trying to add a Windows misfeature to Linux. Linux doesn't have this misfeature on purpose. I call it a misfeature because when Windows does this, it kills off all connections using that network interface even if no packets were ever lost. Also, unless you're in the simplest possible case, with just two machines and a crossover cable (or MDI-X) it ...


6

That's probably because a switch only sends traffic down a port if it believes the destination MAC address is attached to that port. On a managed switch, you'd set up monitor mode. On an unmanaged switch, you're left with a couple of options: ARP spoofing, to trick the rest of the network about which MAC address corresponds to the target IP address. You ...



Only top voted, non community-wiki answers of a minimum length are eligible