Hot answers tagged ip
37
It does this by doing nothing special. The network restarts in less time than the TCP connection takes to time out, so the TCP connection survives the "outage" the same way it would survive any transient network outage.
The only reason Windows doesn't do the same thing is because Windows specifically resets TCP connections when a network interface goes ...
12
An IP address is just a number. One that - as I'm sure you know - uniquely identifies a computer on a network. But still just a number, which we will get back to.
Let's take an example: 192.168.1.105
You'll notice that the IP address is broken up into four parts: {192, 168, 1, 105}. And you probably also know that each of those parts can have a value from ...
12
This is not possible. If it were possible there would be no reason to have a netmask at all as it could be automatically determined.
The netmask is used to specify the IP range a 'network' starts and stops at. This range is arbitrary.
For example, with the IP address 192.168.0.140:
With the netmask of 255.255.255.0 (/24 in cidr notation) the IP range would ...
9
You have the symptoms of an MTU problem: some TCP connections freeze, more or less reproducibly for a given command or URL but with no easily discernible overall pattern. A telltale symptom is that interactive ssh sessions work well but file transfers almost always fail. Furthermore pppoe is the number one bringer of MTU problem for home users. So I ...
9
There was a time when IANA only assigned ports up to 1023. See RFC1700. At one time this was a standard. Most of the time I have no trouble finding when things change in the stream of RFC's but for the question of changing ports from 1024 to 49152 from registered to assigned I came up short.
In terms of Linux history, there was a question raised about the ...
7
"IP forwarding" is a synonym for "routing." It is called "kernel IP forwarding" because it is a feature of the Linux kernel.
A router has multiple network interfaces. If traffic comes in on one interface that matches a subnet of another network interface, a router then forwards that traffic to the other network interface.
So, let's say you have two NICs, ...
7
Whatever dig reports is the truth. You should conclude that www.php53.staging-crm.com maps to 165.160.x.x and php53.staging-crm.com maps to 80.75.x.x.
There is no particular reason why they should map to the same address. It is common these days to have the unadorned domain name map to the same address as www for the convenience of web users, but that is ...
7
Right click on the Network Manager icon on Ubuntu top panel and select edit. Go to Wired Network or Wireless Network tab and select the network name. Click on the edit button and go to IPv4 settings tab on the new window. If the method is Automatic (DHCP) you are using dhcp.
Other method is cat /var/log/syslog and check for some thing like below
...
6
Maybe setup smokeping on the Linux side, and point it at your AP?
Smokeping will periodically (configurable) send -20 pings at the same time, and then graph how how many returned and the range of times that they returned in. If you have a lot of dropped packets, or the really wide range, then you should be concerned.
If you want to run smokeping you ...
6
I've always used this:
tail -1000 /var/log/apache_access | awk '{print $1}' | sort -nk1 | uniq -c | sort -nk1
With tail I'm able to set the limit of how far back I really want to go - good if you don't use log rotate (for whatever reason), second I'm making use of awk - since most logs are space delimited I've left my self with the ability to pull ...
6
Your question implies that both programs would be running in alternation on the same machine, bound to the same port. This is a bad idea. You will run into the TIME_WAIT (a.k.a. 2MSL) problem if you try this. This article describes the problem. (It's Windows-centric, but most of what it's talking about applies to any TCP/IP stack.)
The BSD sockets API does ...
6
I'm going to have to be cheap and copy my answer from this question.
ntop is probably the best solution for doing this. It is designed to run long term and capture exactly what youre looking for.
It can show you which clients are receiving/sending the most traffic, where theyre recieving/sending to, what protocols and ports are being used etc.
It then uses ...
5
You misunderstand regex syntax. [16-32] does not mean "match 16, 17, ... or 32". It means "match one character which is either 1 or 2 or in the range 6-3" (which is not a valid range, hence the error).
It's possible to write a regex to match a range of integers, but it's complex and error prone. In your case, it would be much easier to use nmap's ...
5
Marco Ceppi is right about awk being a better tool for this but awk is also a better tool than sort and uniq since that logic can be moved in to awk. It doesn't make much of a difference if you're just tailing 1000 lines but if you want to look at a huge multi gig log file it can be orders of magnitude faster to move that in to awk.
cat ...
5
You do not need more that one mac address to have multiple ip addresses on a single network interface. This technique is called ip aliasing.
Each operative system has a slightly different syntax but usually, to set different ip addresses on the same interface, you need only to do something like:
ifconfig eth0 192.168.100.200 netmask 255.255.255.0
ifconfig ...
5
You can with the ip command, and given that ifconfig is in the process of being deprecated by most distributions it's now the preferred tool. An example:
$ ip route show
212.13.197.0/28 dev eth0 proto kernel scope link src 212.13.197.13
default via 212.13.197.1 dev eth0
5
I should clarify that the code here works for Linux, (note comments and post about other Unices). OP asked for a Linux solution, but it would be good to change the question to "how to get netmask" in general, and have the answer combine the best way for more Unix flavors.
#!/bin/sh
ifconfig "$1" | sed -rn '2s/ .*:(.*)$/\1/p'
./script eth0
About ...
5
It seems the most kernels(post v1) do support multicast by default or have CONFIG_IP_MULTICAST enabled while compiling. To check whether the compiled and running kernel subscribes to any multicast group, I would use netstat -g.
It seems the most kernels(post v1) do support multicast by default.
[root@centos module]# grep CONFIG_IP_MULTICAST ...
5
Those aren't ip addresses per se, they are ranges. The last number (which, as psusi mentions is called a subnet mask) indicates the number of relevant bits: /16 means the network includes all numbers starting with the first 16 bits of the specified ip (223.248 in your example). A /8 is a class A network with 2^24 addresses, /16 is class B with 2^16 ...
5
You would have to have them on unique ports. You can't have two applications listening simultaneously on a single port. So, in your example, because tunnels 1 and 2 both have an end on Site A, those endpoints must have unique ports. Hence the use of ports 1194, and 1195.
Now, because the VPN links 1 and 2 are using unique ports 1194 and 1195 on A->B, and ...
5
ntop can give you exactly what you're asking for. It collects data about all the traffic flowing through your network (and can collect data from other networks if they have a device configured to send netfow data to your system).
It will show you every host on the network, with how much bandwidth they've used. It will let you drill down into each host and ...
5
Are you the administrator of the remote machine/network?
Yes. You need to forward port 22 (or whichever port you're running ssh on) through your firewall. In addition, I suggest doing a few things to make hacking more difficult, such as switching to a different port, allowing public key only, or limiting remote connections to certain IP addresses.
...
5
You need to set the promote_secondaries option on the interface, or on all interfaces:
echo 1 > /proc/sys/net/ipv4/conf/eth0/promote_secondaries
or
sysctl net.ipv4.conf.eth0.promote_secondaries=1
Change eth0 to all to have it work on all interfaces.
This option has been in since 2.6.16 or so: ...
4
It's not so easy if you want to take into account wlan and other alternative interfaces. If you know which interface you want the address for (e.g., eth0, the first Ethernet card), you can use this:
ip="$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
In other words, get me the network configuration information, look for eth0, ...
4
The command is the easy part, the difficult part is having access to a database.
For example, Ubuntu has a free database with a command line query tool (geoiplookup) in the geoip-bin package. But it only shows country information, and uses a static (hence out-of-date) database. This tool can also query the MaxMind GeoIP database, if you have a subscription ...
4
You don't want to intercept this in the air. It's very hard to do well. I suggest you change your network around a bit. You'll need a PC with two network interfaces and two routers to pull this off. Here's how I would do it:
Internet --> Router --> Ubuntu machine --(network port)--> Wifi router --> iPod
Ubuntu needs to "share" the Internet ...
4
Yes, you can do that.
You should look into dnsmasq. It is designed to serve this very need.
The default DHCP server on Linux is usually ISC dhcpd. It's possible to make it work in this role, too, but it's a bit more difficult to configure, and it has to be manually configured to get the DNS server integration you get for free with dnsmasq.
4
There are several usual notations for IPv4 and IPv6 addresses. Here's an extended regular expression, suitable for Perl m//x, that captures the usual notations. If you remove the comments and whitespace, you can use it with grep -E, awk, or any other utility that uses extended regular expressions (ERE).
^(
...
4
The saved portion of each captured packet is defined by the snaplen option. In some distributions, the default snaplen is set to around 68 bytes. The packets are then truncated to 68 bytes, hiding some of the payload. You can save the complete packets by setting the snaplen to 0 (i.e. maximum) as follows: tcpdump -s0 -w test.pcap -i eth0
4
You could use something like this:
while true; do nc -lvp 1337 -c "echo -n 'Your IP is: '; grep connect my.ip | cut -d'[' -f 3 | cut -d']' -f 1" 2> my.ip; done
nc will be executed in endless loop listening on port 1337 with verbose option that will write information about remote host to stderr. stderr is redirected to file my.ip. Option -c for nc ...
Only top voted, non community-wiki answers of a minimum length are eligible