91 votes

How do I delete a route from Linux routing table

with the route -n command you'll obtain Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.178.1 0.0.0.0 UG 0 ...
19 votes

Windows: Get the interface number of a NIC

The following command displays the list of interfaces: netsh int ipv4 show interfaces
  • 201
19 votes
Accepted

How does an IP packet know which gateway to take?

TL;DR: the gateway's address is only stored in an Ethernet frame that holds that TCP/IP packet The server->switch->router traffic, as well as server->switch->server traffic, is where IP ...
  • 13.7k
14 votes

Carrier Grade NAT concepts: IP bans

That is indeed one of the problems with CGN. Sharing a resource means that all suffer the consequences when one abuses the resource. A bank that I consulted for implemented IPv6 on the server side ...
11 votes
Accepted

Map IP to another IP

Ok, after a small chat with Yahia Zakaria I managed to pinpoint the problem. The app uses more than TCP to communicate, so the proper DNAT should look: iptables -t nat -A OUTPUT -d 192.168.1.15 -j ...
6 votes

How does an IP packet know which gateway to take?

The IP datagram header only contains address information of the source and the destination. Based on the destination, the router should know where to forward the packet next, and this information is ...
  • 44.8k
5 votes
Accepted

problems when openvpn server is not the default gateway

The VPN client must have route to reach the network, but the machines on the network must also have routes to send back the response. So you have to instruct the machines on the local network that to ...
  • 2,018
5 votes
Accepted

ip rule and route doesn't get respected

Your issue isn't issue. In rule you use not only source address, but also input interface match. So, there are two ways to solve your "problem": Don't use the dev eth0 in the rule Add iif eth0 in the ...
5 votes
Accepted

networkmanager-strongswan vpn - routing specific ip through VPN

In the present state of charon-nm there is no 'setting' to define the remote network at the other end of the tunnel. The VPN client by default proposes the full address space and depends on the VPN ...
  • 1,497
4 votes
Accepted

How to use another IP-address for outgoing traffic?

Most networking related tools like ping will have an option to select the source IP they will use for outgoing connections, so for example with ping you can use ping -I IP-B. For all traffic to use ...
  • 673
4 votes
Accepted

How to change loopback network mask or redirect subnet to another interface

As mentioned in What is the rest of the 127.0.0.0/8 address space used for? , the 127.0.0.0/8 block is the loopback block, and all packets destined to the block must be looped back to the origin host. ...
4 votes

Routing table with two same static IPs on the network

You can do this with a VPN that can work at Layer 2, like OpenVPN ethernet bridging. See https://openvpn.net/index.php/open-source/documentation/miscellaneous/76-ethernet-bridging.html Another way to ...
3 votes

Static Route Still Uses Wrong Gateway

Looks like when you added the static route you added it on the wrong interface on machine 1. If you don't specify an interface, Windows picks one by itself and I'm not sure what it uses to choose but ...
3 votes

Unable to set up a static host route - "SIOCADDRT: No such process"

You can get the "SIOCADDRT: No such process" error if "You attempted to set a route for a network before setting a host route for the gateway which handles traffic for that network." e.g. for local ->...
  • 183
3 votes
Accepted

Who holds core Country > IP data?

The main repository is at IANA: https://www.iana.org/numbers. You then have more local regions for: Africa: http://www.afrinic.net/ Asia/Pacific: https://www.apnic.net/ (most of) North America: ...
  • 2,326
3 votes
Accepted

How to create a protocol-based default route using iproute2

This is completely untested, but maybe something like this? This method uses firewall marking. # part ip packets with a value of 100 as a protocol iptables -A PREROUTING -i eth0 -t mangle --proto ...
  • 130k
3 votes

Routing table with two same static IPs on the network

Maybe you can configure a bridge using bridge-utils. That way you don't even need to configure those IP addresses on the middle box. This of course depends on why you need to have this box in between....
  • 248
3 votes

SNAT to from different source IP's to multiple destination IP's

As I can see now, from your detailed update, most likely it seems that you don't have those IP's assigned on your local network interface. You've only added 111.222.62.130 on your server. In order for ...
  • 1,278
3 votes

How does an IP packet know which gateway to take?

Short and simple answer: It doesn't get encoded in the packet, or it is the Ethernet target address depending on how you look at it. The IP/Ethernet stack looks at what gateway handles the destination ...
3 votes

linux - routing between bridge networks without overlay

if I understand correctly, you want something connected to host1 or host2 through its bridge to talk to the other host ? you would do ip route add 172.11.11.0/24 via 192.168.1.197 # on host2 ip ...
2 votes

iptables rule to set source IP depending on local userid

Now (iptables v1.4.21) it's works in one step: iptables -t nat -A POSTROUTING ! -o lo -m owner --uid-owner 1030 -j SNAT --to-source 10.0.0.85 And the user with uid 1030 will be originating all ...
2 votes
Accepted

IP Routing on All Switches or just Core

If the VLANs are trunked to the other closets, you only need ip routing on the core switch.
  • 196k
2 votes

When is route lookup performed when a packet flows through iptables?

The confusion with that diagram is that not all "Routing Decisions" are created equal. The one after "nat PREROUTING" is a simple local/remote choice; if the packet's destination is local, it goes ...
  • 95.8k
2 votes

Routing issue on Linux with Mobile Broadband

Yes, that routing table shows there is no route to 8.8.8.8. The only routes are the 47.53.62.0/24 subnet and the loopback. A default (0.0.0.0/0.0.0.0) route (or a number of more specific routes if ...
  • 196
2 votes

route between 192.168 and 10.10

Hook an ethernet cable up between the two ASA's. Assign a /30 subnet for a link between the two routers, for example 10.11.0.0/30 with one endpoint being 10.11.0.1 and the other being 10.11.0.2. If ...
2 votes
Accepted

Connection SSH port 22 via domain name but not public ip address

Based on the limited information in the question it is not possible to say for sure why connectivity using a hostname works but connecting to the very same server using an IP address does not work. ...
  • 30.2k
2 votes

Better routing path to reduce network latency to China

There's really not a whole lot you can do on a purely routing level: you are dependent on whatever routing decisions your ISP has made. Adding routes to your home router won't do anything, as it ...
2 votes
Accepted

OpenVPN Routing to LAN Behind Server

You may be missing the iroute. Over and above pushing routes, you would need iroute in configuration files. Here is the excerpt from OpenVPN man page. --iroute network [netmask] Generate an internal ...
  • 136
2 votes

Routing table with two same static IPs on the network

It is not clear why you want to give these specific addresses to your middle box. If you just need to pass packets to the other end, there is no need for that, you can use bridging (or optionally ...
  • 3,313
2 votes
Accepted

How do routers route packets in the event a router goes down?

In general, routers use protocols like RIP (slightly outdated) or OSPF and IS-IS (more modern) to determine the best current route to a specific network. "Best" obviously will include "is not down".
  • 246

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