Hot answers tagged

79

Your original assumptions are not entirely correct. What you call a "router" is two devices in one – a two-port router internally connected to a multiple-port Ethernet switch. (Here's an example diagram.) This means that the computers are directly connected at layer 2, and can send packets to each other without going through the router core – they're simply ...


32

How does a computer know if a destination address is in the same subnet on in another? Checking the local adddress and the subnet mask. Let's check a couple examples: If my computer has the IP 192.168.0.1 and the mask is 255.0.0.0 it means that any address from 192.0.0.0to 192.255.255.255 is in the same subnet. The packets to all those other computers don'...


29

Yes, the easy way to think about it is that subnet masks are always 1s at the start. If a subnet-size-indicator doesn't have 1s at the start of the binary representation, then I would say that the subnet-size-indicator is not a proper “subnet mask,” using modern standards. RFC 1219 states that the earlier RFC 950 permits non-contiguous bits. In fact, RFC ...


26

/32 addressing Generally speaking, /32 means that the network has only a single IPv4 address and all traffic will go directly between the device with that IPv4 address and the default gateway. The device would not be able to communicate with other devices on the network. There are a couple of possible reasons for this that I've seen. It could be: A ...


26

There's a bit of confusion here; that /32 doesn't refer to the size of any (sub)network, but to the range of addresses that particular routing table entry applies to. Usually the two are the same (because you route a network or subnet as a unit, right?), but macOS does things a little different for other hosts on the same local network. Let me add some lines ...


19

The section 3.1 in the RFC shows the allowed masks in the classless inter-domain routing. The bits have to be contiguous for the routing to work properly. Also when thinking logically it would not really make sense to have strange random network masks.


17

Basically a valid subnetmask, when written in binary, has to consist of only consecutive 1's and then 0's, but no intermittent mixing. I.e.: 255.255.255.128 -> 11111111.11111111.11111111.10000000 is valid 255.255.255.0 -> 11111111.11111111.11111111.00000000 is valid 255.255.255.144 -> 11111111.11111111.11111111.10010000 is not valid Edit: The ...


16

Should I just change my computer's IP Address to be 192.168.10.something, or is there another way? If you only temporarily need to speak to 192.168.10.10, this will be the easiest thing to do. I'm simplifying the following a bit to explain better: For your computer to talk to any computer, your system must have an entry in its local routing table (or ...


13

Some IP address basics IP addresses are internally represented as a 32 bit value. The topmost N bits identify the network, the rest of the number identifies the host in the network. Let's look at two examples IPs, let's first look at the 32 bits: 10101100000100100000000010010110 10101100000100100000000110010110 You can rewrite the IP in an easier ...


13

The theory of the subnet mask is that it defines what part of the IP address is the network address and what part of the IP address is the host address: 10.100.0.1 - IP address; 255.0.0.0 - Subnet mask; 10 - network address, 100.0.1 - host address. Hosts within same subnet can talk directly to each other. That means if host A and B are located within the ...


12

Something non-obvious about IP is that every IP device is itself a router. This can be seen on a normal PC with the command "route print". You are connected to two networks: your local Ethernet or wifi segment, and the localhost network. Every packet needs to be subject to a decision as to which network to put it on. This becomes more apparent if you put ...


10

The way to accomplish this using consumer grade equipment is using a 3 router Y configuration By setting the two routers up using the same subnet but on different "LAN"s it is impossible for one network to talk to the other network. Think of it this way: you have a computer on LAN A with a IP of 192.168.1.2 and a one of the wireless clients on LAN B with ...


9

1 year late but your problem might be the OpenWRT firewall which seems to forbid ip forwarding on the LAN interface when the source&destination subnets aren't the same. retry pinging after this one : /etc/init.d/firewall stop if it works, then u gonna have fun with the rules !


9

each router interface should be in different subnet? The error in your logic lies in the assumption that network topologies always involve routers which strictly pass packets received on an interface in one subnetwork out via an interface defined in a different subnetwork. While that is true in common SOHO and medium-enterprise environments, it is not the ...


9

It is not valid. A subnet mask needs to be continuously 1-filled from the left. This is the reason why you can use the alternative notation with /x, where x describes the number of 1-bits (the size of the network prefix). It basically specifies which bits from the left identify a network and which bits (the 0s on the right) need to be ignored as they differ ...


8

Preferred is what your client will ask the DHCP server for when it gets/renews the lease, but tentative is what it got in the response. Someone else probably has a lease on the preferred address. Duplicate is what it says when windows detects an IP address conflict (and then probably switches to another address). To manually release and renew now: ipconfig ...


7

You need to distinguish the subnet start address and the subnet size. The number behind the slash is the size (in 32-x bits). So you can have two /27 subnets like this 10.0.0.1/27 == 10.0.0.1 -> 10.0.0.30 10.0.0.33/27 == 10.0.0.33 -> 10.0.0.62 but a /27 and a /25 subnet in the same way would mean starting the /25 at a later address 10.0.0.1/27 ==...


7

The 192.168.* range is private so you can technically do this without causing IP address collision problems on the wider Internet. However, conventionally the 192 octet range is used for Class C networks, which have a subnet mask of 255.255.255.0, allowing communication across only one octet range of computers (255). What you are describing is a Class B ...


7

255.255.255.0 is 0b11111111.0b11111111.0b11111111.0. One wider, 0b11111111.0b11111111.0b11111110.0, is 255.255.254.0. One narrower, 0b11111111.0b11111111.0b11111111.0b10000000, is 255.255.255.128.


7

IPv4 addresses use 32 bits. For example the adddress 127.0.0.1 translated to binary is 01111111 00000000 00000000 00000001. For easy understanding instead of binary we, humans, use a decimal representation separating the 32 bits in 4 blocks of 8 bits. Each block of 8 bits can go from 00000000to 11111111, or in decimal from 0 to 255. The IP address is ...


7

I see this mentioned in some of the other answers here but I think it could be clearer: On computers with multiple network interfaces, the subnet mask may be used to automatically determine which physical interface to send IP traffic on based on the destination IP address. If you're sending a packet to a device on a LAN connected to one of the interfaces, ...


6

I finally found out what the problem was. I am using OpenVPN's "routing" option which creates a new subnet for all OpenVPN connections. My client was getting assigned an IP address from this subnet, and so was my server, so they could talk to each other across this network. With IPv4 forwarding enabled on my server, I was also able to send packets out onto ...


6

Both your routers are performing Network Address Translation on traffic going from their LAN interfaces to their WAN interface. If you disable NAT on the second router, your problem will most likely be solved. If the option is not included in the manufacturer's firmware, you might want to check if your devices are compatible with DD-WRT. Here's what happens ...


6

If you want to whitelist one specific IP address, then express it as 1.2.3.4/32 However, you're not clear as to whether your home IP address is static or dynamic. If the latter, you'll have to ask your ISP for the ranges of addresses it could allocate from. There may be several discontiguous ranges of different sizes that have been acquired as the ISP ...


6

It is completely possible to change your subnet to include 192.168.0.x and 192.168.1.x. The network would be 192.168.0.0/23 and the subnet mask would be 255.255.254.0. You will have to change this on all devices though. This would probably be the best way without getting into vlans or static routes. The other option is to see if it is possible to just ...


6

I have a class 'B' IP address 172.16.XXX.XXX in my machine But from Wikipedia I get that class 'B' should have 255.255.0.0 as subnet mask. The "class B" IANA-reserved private network actually has subnet mask 255.240.0.0, not 255.255.0.0. Let me offer some clairity on how subnet masks work. IP addresses enable: multiple systems on a network to ...


6

IP subnets exist to allow routers to choose appropriate destinations for packets. You can use IP subnets to break up larger networks for logical reasons (firewalling, etc), or physical need (smaller broadcast domains, etc). Simply put, though, IP routers use your IP subnets to make routing decisions. Understand how those decisions work, and you can ...


6

TCP/IP could have been designed as you suggest -- leaf nodes would send everything to the router, and it would forward it to the target, which might be on the same subnet as the sender. But this would not be optimal design, for two reasons: It uses more bandwidth: Every packet between devices on the same subnet has to be transmitted twice: once from the ...


6

Your best bet is to buy a cheap mini-PC and run pfSense. pfSense is the software part of a very, very high level Firewall/Router and runs on commodity hardware (x64 PC). It is used heavily in enterprises as well as small shops. And it is free.


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