Questions tagged [routing]

Routing (in IP-based networks) is the process of selecting paths in a network along which to send network traffic.

Filter by
Sorted by
Tagged with
96 votes
2 answers
109k views

What is kernel ip forwarding?

I have seen on many blogs, using this command to enable IP forwarding while using many network security/sniffing tools on linux echo 1 > /proc/sys/net/ipv4/ip_forward Can anyone explain me in ...
user avatar
  • 1,461
88 votes
12 answers
135k views

How to find out which interface am I using for connecting to the internet?

I have eth0 and wlan0 according to ifconfig and I can ping google.com. How can I find out (with a normal user, not root) what interface is active, as in, what interface did the ping (or whatever, ...
user avatar
  • 36.7k
86 votes
4 answers
164k views

What is the meaning of 0.0.0.0 as a gateway?

Can anyone clarify gateway assignment for me? What is the difference between adding a gateway as 0.0.0.0 and assigning a specific IP address as a gateway?
user avatar
  • 3,339
75 votes
4 answers
90k views

Reply on same interface as incoming?

I have a system with two interfaces. Both interfaces are connected to the internet. One of them is set as the default route; a side effect of this is that if a packet comes in on the non-default-route ...
user avatar
61 votes
4 answers
70k views

Bind unix program to specific network interface

Question: How do I launch a program while ensuring that its network access is bound via a specific network interface? Case: I want to access two distinct machines with the same IP (192.168.1.1), but ...
user avatar
  • 991
45 votes
4 answers
126k views

Use ssh with a specific network interface

I'm using openconnect to connect to vpn. After entering my credentials, I get this: POST https://domain.name/... Got CONNECT response: HTTP/1.1 200 OK CSTP connected. DPD 30, Keepalive 30 Connected ...
user avatar
  • 614
37 votes
3 answers
55k views

How to refuse routes that are PUSHed by OpenVPN server?

When I establish an OpenVPN client connection over the Internet to our corporate OpenVPN server, it pushes several static routes. Unfortunately, these routes break some connectivity within my local ...
user avatar
  • 4,521
27 votes
2 answers
34k views

Tools for Debugging Routing Tables on a Linux Machine?

Is there a tool that debugs routing tables on a Linux machine? I mean one that I can use by inputting an ip address into it, it'll take the existing routing table into account and output the ...
user avatar
  • 4,159
27 votes
4 answers
91k views

Output traffic on different interfaces based on destination port

My question is basically the same as Only allow certain outbound traffic on certain interfaces. I have two interfaces eth1 (10.0.0.2) and wlan0 (192.168.0.2). My default route is for eth1. Let's say ...
user avatar
  • 374
25 votes
1 answer
176k views

OpenVPN: Push a route to client with a different gateway

I would like my OpenVPN server to push a route down to the client with a different default gateway. Specifically, my OpenVPN server has an internal IP address of 10.0.0.1, and I would like it to ...
user avatar
23 votes
7 answers
266k views

How can I change the default gateway?

Currently I'm running a FreeBSD 9.1 and the default gateway is already configured in the rc.conf. rc.conf: defaultrouter = "10.0.0.1" But now I want to change the default gateway without rebooting ...
user avatar
  • 333
22 votes
2 answers
41k views

How can I use Linux as a Gateway?

NOTE: If client devices (computer B in this example) want to obtain internet through the gateway computer, maybe they still need to configure nameserver resolution. This is not explained here (a ...
user avatar
21 votes
3 answers
20k views

OpenConnect: Setting default routes

I'm trying to use OpenConnect to connect to my company's Cisco VPN (AnyConnect) The connection seems to work just fine, what I'm not understanding is how to set up routing. I'm doing this from the ...
user avatar
  • 1,497
20 votes
4 answers
123k views

Modifying existing route entry in linux

what is the command to modify metric of an existing route entry in linux? I am able to change gateway of an existing entry using "ip route change" command as below but not able to change metrics. Is ...
user avatar
20 votes
3 answers
35k views

What is the interface scope (global vs. link) used for?

Routing table entries have an attribute scope. I would like to know how the change from global to link (or the other way round) affects the network system.
user avatar
  • 82.6k
18 votes
4 answers
187k views

How to remove all default gateways

I'm running a custom built Linux machine, so not all Linux commands are available. I execute network related commands, so I need to set a default gateway right before I run my command, then remove ...
user avatar
18 votes
1 answer
22k views

Linux as router with multiple internet providers

Linux as router: I have 3 Internet providers, each with its own modem. Provider1, which is gateway address 192.168.1.1 Connected to linux router eth1/192.168.1.2 Provider2, gateway address 192.168.2....
user avatar
  • 183
17 votes
8 answers
76k views

Can I prevent a default route being added when bringing up an interface?

I have a system with two NICs on it. This machine, and a few accompanying devices will be moved and attached to different LANs or sometimes it'll be using dial-up. eth0: - 10.x.x.x address ...
user avatar
  • 275
17 votes
3 answers
45k views

In Linux, what metric has a route with no metric?

If you have (in Linux) these two routes: default via 192.168.1.1 dev enp58s0f1 default via 192.168.16.1 dev wlp59s0 proto static metric 600 I would expect that the first one is used, but that's ...
user avatar
  • 902
17 votes
6 answers
44k views

How to route specific addresses through a tunnel?

There are certain websites/services which I can only access from the subnet on which my server is located (think of the typical intranet scenario). Is there a way to transparently route traffic that ...
user avatar
17 votes
2 answers
66k views

iptables --set-mark - Route diferent ports through different interfaces

Short story, 3 interfaces, eth0 (LAN), eth1(ADSL), eth2(4G). eth0 -> eth1: Works (ports 80, 443, 4070) eth0 -> eth2: Doesn't happen This is a graphical representation of the idea: Port 80 & 443 ...
16 votes
5 answers
58k views

How can I make changes to the network routing metric permanently

I'm able change my network routing metrics with ifmetric, for example ifmetric enp0s3 1. Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 ...
user avatar
  • 768
16 votes
4 answers
63k views

Trying to connect to gateway in static ip network

I have arch-linux-arm running on a raspberryPi. The network I am in uses static IPs. gateway IP is 192.168.178.5 IP for my device is 192.168.178.201 To connect to the internet I use: ip addr add ...
user avatar
  • 1,069
15 votes
1 answer
62k views

OpenVPN - Understand the routing table + How to route only the traffic to a specific ip via the VPN

I'm connecting to a VPN service using OpenVPN and everything works fine. Once I connect these are the rules that automatically are set: root@linux:~# ifconfig eth0 Link encap:Ethernet HWaddr 00:...
user avatar
  • 249
15 votes
3 answers
4k views

Can I limit a user (and their apps) to one network interface?

I've actually got two scenarios to apply this: Multiseat Desktop: two network connections both with internet gateways and two accounts doing bandwidth-intensive tasks on each. I want to split them up ...
user avatar
  • 15.2k
15 votes
1 answer
13k views

how to understand the routing table on an OpenVPN client

I just setup the OpenVPN and it is working as expected. However, the routing table of the client is confusing me to no end. Here is the route table: # route -n Kernel IP routing table Destination ...
user avatar
14 votes
3 answers
9k views

scp between two servers not in the same network

There are two server that I can access with 2 different VPN connections. I have managed to have both VPN working on the same time on my machine (a bit of routing rules). I want to do a scp <...
user avatar
  • 482
14 votes
2 answers
29k views

Separate Network Traffic on Two Network Interfaces

Could you lend your expertise in understanding how to go about configuring the separation of network traffic on two network interfaces? As I understand thus far, static routes are used for network ...
user avatar
  • 14.9k
13 votes
2 answers
7k views

Change remote host IP address without losing control (Linux)

How can I change a remote host primary IP address without getting disconnected at all (without being in a "no IP addr" state). The matter is poorly discussed on Internet (according to my research). ...
user avatar
  • 17.9k
13 votes
1 answer
17k views

Routing public ipv6 traffic through openvpn tunnel

What I'm trying to do is to route IPv6 traffic through a vpn tunnel. That way, I should be able to use IPv6 in a network that doesn't support IPv6. I have a VPS which has an IPv6 block assigned. Part ...
user avatar
  • 261
13 votes
2 answers
5k views

Linux Source Routing, Strong End System Model / Strong Host Model?

Can a multihomed Linux machine implement a true Strong ES Model? ###Specific Use Case I have a system with five different interfaces, each connected to the same subnet, thus the same gateway to the ...
user avatar
  • 2,484
13 votes
2 answers
5k views

1:1 NAT with several identical LANs

I want to connect several LANs located on remote buildings. The "central" site have a Linux computer running OpenVPN. Each remote site also run OpenVPN. the central site has a LAN numbered 192.168.0....
user avatar
12 votes
2 answers
28k views

Routing Between Multiple Subnets

Let's say I want to create an internal network with 4 subnets. There is no central router or switch. I have a "management subnet" available to link the gateways on all four subnets (192.168.0.0/24). ...
user avatar
  • 123
12 votes
1 answer
9k views

Understanding ip route output

I am learning about Linux routing, routing tables, IP routing, etc... The following is the output from ip route followed by the output of route: default via 192.168.1.1 dev wlp0s20f3 proto dhcp ...
user avatar
  • 361
11 votes
1 answer
9k views

OpenVPN Client and Server on same machine - Server doesn't allow connections when client is connected

I am new to this community and am hopeful that somebody can help me. Please let me know if I haven't posted all required information. Situation: I have a linux server (raspberry pi, 192.168.1.2) ...
user avatar
  • 261
10 votes
3 answers
14k views

How can I view IPv6 router advertisements that are being received by my computer for diagnostic purposes?

How can I view IPv6 router advertisements that are being received by my computer for diagnostic purposes? Are there any tools "built-in" to the majority of distros?
user avatar
  • 535
10 votes
1 answer
86k views

Adding two default gateways in Debian interfaces file

This is my interfaces file: auto eth0 iface eth0 inet static address 192.168.1.10 netmask 255.255.255.0 gateway 192.168.1.1 auto eth1 iface eth1 inet static address 192.168.2.10 ...
user avatar
  • 808
10 votes
2 answers
35k views

forward packets from one interface to another interface using iptables

I have an embeded system with 2 interfaces e0 and m0, whose ips are 10.0.0.20 and 192.168.0.20, respectively. Incoming packets into e0 have an ip of 10.0.0.10 and should be forwarded to m0 interface ...
user avatar
  • 101
9 votes
3 answers
20k views

NetworkManager changes default routing policy

I have a machine with a built-in NIC (eth0), which serves as a DHCP server for a Raspberry Pi. I also have a USB 3G modem, which shows up as ethernet device eth1. eth0 has the static ip 192.168.100.1 ...
user avatar
  • 201
9 votes
4 answers
11k views

ssh will sporadically hang temporarily on fast connection

I am using Ubuntu 13.04 on my laptop, connected to my router at home. When working from home, I will ssh into the servers on campus, through a vpn, with X11 forwarding. ssh -X server.address.on....
user avatar
  • 537
9 votes
1 answer
4k views

Dual network connection

I have a usb cellular modem and a Home LAN connection on my Ubuntu 10.10 box. Both work independently. I want to know how to have both connected at the same time, and be able to specify which ...
user avatar
9 votes
1 answer
41k views

How to route between interfaces

I have the following setup: (192.168.4.1) Device A <-------> device B <-------> Device C (192.168.5.84) (192.168.5.1) (192....
user avatar
  • 121
9 votes
1 answer
9k views

Network interface preference

How does Linux determine which network interface to use, when both are connected to the same network? Note that this isn't a question on routing. I'm familiar with how that works. This is if, say, I ...
user avatar
9 votes
2 answers
8k views

What does iptables -j REDIRECT *actually* do to packet headers?

Out of curiosity I'm reading some tutorials about transparent TOR proxies as it's quite interesting topic from a networking standpoint. As opposed to VPN gateways which just use tun/tap interfaces and ...
user avatar
  • 1,213
9 votes
1 answer
4k views

Routing on per application basis

I'm using a proprietary VPN client on my Ubuntu Linux work station (Astrill) which support several types of VPNs. One of these VPN types is OpenVPN, which creates a virtual interface tun0 when ...
user avatar
  • 8,233
8 votes
1 answer
26k views

iptables routing incoming IP to another destination IP question

I have a test setup: server1:1.1.1.1 server2:2.2.2.2 client: 3.3.3.3 I'm trying to have client IP 3.3.3.3 do a HTTP request from the 1.1.1.1 server. However I want the 1.1.1.1 server to pass this ...
user avatar
  • 409
8 votes
2 answers
14k views

Redirect ALL packets from eth1 & eth2 through a SOCKS proxy

Is there a way to redirect all traffic, UDP and TCP, coming to and from eth1 and eth2 through a SOCKS proxy (Tor) which then passes it through eth0? eth0: Internet in - leads to the main router, then ...
user avatar
8 votes
3 answers
15k views

How can I disable automatic IPv6 neighbor route advertisement on a router?

I work for an ISP that's in the process of making its infrastructure IPv6-ready. Our core routers already have a working setup, but a large portion of our fiber customers are behind a router running ...
user avatar
  • 29k
8 votes
2 answers
6k views

linux multiple internet connections load balancing with fail handling

I have two ISP connections and need automatic load balancing between them. I also need to handle failed connections (not use one that does not work). First link is a PPTP connection (ppp0), second is ...
user avatar
8 votes
2 answers
19k views

How can I forward traffic across two Ethernet cards?

I'm having a hard time figuring out how to set this up right. I can barely formulate a google query that explains it, so I'll try to do my best. I have a Ubuntu PC with two NIC cards. eth0 (192.168....
user avatar
  • 81

1
2 3 4 5
21