Ubuntu :: Multiple NICs, Route Traffic Based On IP?

Apr 22, 2011

I have an Ubuntu server box with multiple NICs. I'd like to specify that all traffic bound for a certain IP range goes through one NIC, and everything else goes through the other. Does anyone know how to do that? I'm not a total newbie, but I'm also not a linux guru (but usually can google my way to a solution...usually).

ETA: Source and destination IP for routing.We have 1 NIC with a public IP, all public IP's should talk to it.Another NIC with a private IP, all private traffic should talk to this.In practice, I have some devices on a different subnet of the public IP range we have that will only talk to the private IP.

View 2 Replies


ADVERTISEMENT

Networking :: Using Route Tool To Forward Traffic Between Two Nics?

May 10, 2011

I am trying to set up a Linux box that can act as a router (and firewall later). I have a Debian 5 installation and it has two nics in it. I am trying to use the linux route command to set up a route between the two interfaces. I am finding it difficult to do. Let me explain how I am trying to set up my network: I have the ethernet cable from my modem connecting to eth0 of my Debian box, then I have eth1 connecting to a switch, which I connect all my computers and other devices to. I want to have two different ip address schemes for the devices. So here is my interfaces file:

Code:

#eth0 connects to modem
allow-hotplug eth0
iface eth0 inet static

[code]....

So I am wondering, to get my ethernet traffic from eth0 to eth1 and vice versa, do I need to make it so the Gateway for Destination 192.168.1.0 is 10.1.1.1, and for Destination 10.0.0.0, Gateway 192.168.1.0? I have looked at the linux manpage for route and I am still confused. I have also looked at the Debian networking page, but it is still unclear to me how to do this. how I am to use the route command to get this working? Or am I not even supposed to use the route command?

View 4 Replies View Related

Networking :: Unable To Route Traffic Based On Packet Content

May 7, 2011

My linux machine is connected to the outside internet, and I have a minecraft server running on an internal machine (192.168.1.201). Right now, I am forwarding port 80 on the linux machine to 192.168.1.30, which is working.

iptables -t nat -I PREROUTING -i eth0 -d 192.168.1.30 -j DNAT --to-destination 192.168.1.201
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -m state --state NEW,ESTABLISHED,RELATED -j DNAT --to 192.168.1.201

______________________________

I want to filter out the GET/POST requests and forward them to port 8080. I can't seem to get that working.

I've tried this:

iptables -A INPUT -d 192.168.1.30 -p tcp --dport 80 -m string --algo bm --string 'GET' -j REDIRECT --to-ports 8080

View 1 Replies View Related

Networking :: Route Packets Across NICS's?

Mar 11, 2010

I have two NIC's interfaces on my linux machine(eth1 and eth2). Each have different IP addresses(10.0.0.1, 10.67.7.1). These two interfaces are connected together through hub. Here is the my question?

1) If I 'ping 10.0.0.1', it should go out through network interface eth2 and through hub and enter on eth1 and response also travel through similar direction.

2) If I 'ping 10.67.7.1', it should go out through network interface eth1 and through hub and enter on eth2.

How can setup routing table for this,I have tried setting up routing and iptables, etc.. nothing helped.

If any one good router/networking guy, you should know this one.I am doing a project, I want this way to handle this.

View 9 Replies View Related

Networking :: Split Traffic Over 2 Nics?

Feb 25, 2011

I'm running 2 asterisk box (Centos) ,and the two servers are connected through 2 iax trunks.on one server i have 2 nics ,each one is connected to internet,now i want to use isp 1 for the first trunk and isp 2 for the second trunk.

iax 1 is listening on 12345
iax 2 is listening on 11223

is there a way to split traffic on both nic using ports (netfilter iptables)?

View 1 Replies View Related

Networking :: Ping Multiple Devices Via Multiple NICs?

May 20, 2010

I have an old pentium 3 computer that has ~7 NICs installed. These NICs are attached to modems and other networking equipment. According to the linux ping page on computerhope.com, it seems that one could send a ping from a certain specified NIC. How would one go about this?

View 6 Replies View Related

CentOS 5 Networking :: Multiple Nics With Multiple Gateway ?

Jun 16, 2009

I have a CentOS 5.3 box with three network interfaces in it. Each interface is attached to a separate VLAN and I want traffic to stay on each network segment.What I can�t figure out is why I cannot get each interface to have its own gateway and everything gets sent through the default gateway.The basically takes my possible 3Gb total bandwidth and throws it down a single 1Gb pipe.Then on top of that, if I take down the interface (ifdown) that has the current default gateway,I loose contact to the other two interfaces.When I look at the routes, each one of the interfaces shows the gw as 0.0.0.0 and defers to the default route. So I delete the route and try to add a new route with:

[root@testsan ~]# ip route add 10.1.15.0/24 via 10.1.15.1 dev eth2

but end up with the error:

RTNETLINK answers: Network is unreachable

[root@testsan sysconfig]# cat network
NETWORKING=yes
NETWORKING_IPV6=no[code].....

View 5 Replies View Related

Networking :: How To Route Traffic To The Vpn

May 11, 2010

I've succesfullly connected to my vpn with kvpnc, but none of my traffic is going through the vpn! I dont know how to route traffic to the vpn. for instance, when I go to whatsmyip.com it still has my previous ip.

View 1 Replies View Related

Ubuntu Networking :: Route Traffic From Wlan0 Through Eth0?

Dec 10, 2010

I'm running Linux Mint 10 . I have a wireless PCMCIA card (Linksys WPC 11 ver.3) that I've put into master mode, and I'm trying to set up my laptop as a wireless hotspot. I am very confident that I want to do this and have no interest in using a wireless router....I say that because that topic inevitably comes up with posts like this. The problem I'm having is I don't understand how to get wlan0 and eth0 to "talk" to each other...That is, I don't know how to set it up so that traffic from wlan0 goes through eth0, so that devices that connect to my hotspot can access the internet.I've seen a few guides about this, but they were either much broader in scope (i.e. much more complex), or for other distributions, etc, and it's too much for me to follow as a linux .

View 6 Replies View Related

Ubuntu Servers :: Securely Route All Traffic On The Client?

Mar 22, 2011

I am running Ubuntu Server 10.10. I have installed OpenVPN using this guide I have set up everything correctly as this guide says, but I am having problems with the config file. I want to securely route all traffic on the client to the server, how ever the server will not start. My config is below:

Quote:

#################################################
# Sample OpenVPN 2.0 config file for #
# multi-client server. #
# #
# This file is for the server side #

[Code]......

The servers ip is 10.0.0.65 and I want to assign the clients the ip range of 10.0.0.200 to 10.0.0.20 When I try to start the server I get the message Fail.

View 8 Replies View Related

Networking :: Route Internet Traffic Over Second IP Address?

Mar 4, 2010

My ISP has given me 3 IP addresses to use for the internet (76.148.200.3, 76.148.200.4 and 76.148.200.5).

If I do a "wget whatismyip.com" or netcat into another server, I am appearing as 76.148.200.3.How do I change my route (command line) in linux to route internet traffic through 76.148.200.5?

Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
code....

View 9 Replies View Related

Networking :: Route Internet Traffic Over Tun0?

Mar 28, 2010

I have eth0 and tun0. tun0 is a VPN tunnel going over eth0. Everything on the other end is setup and working fine, when I type Code: traceroute 4.2.2.1 I see my the ping is going over 192.168.2.99 (eth0). When I then type Code: route add -net 4.2.2.1 netmask 255.255.255.255 dev tun0 traceroute 4.2.2.1 I see ping is going over 10.8.0.1 (tun0) instead of eth0, so that is working

What does not work however is when I do Code: route add -net 0.0.0.0 netmask 0.0.0.0 dev tun0 traceroute 4.2.2.1 I get no ping! I believe the problem is because all traffic is routing over tun0, which means even the VPN tun0 needs to go through eth0, it can no longer do this. Is there a way around this where I can route everything except for 114.77.31.26 (which is my VPN gateway for tun0)?

View 18 Replies View Related

Networking :: Route All System Traffic To Localhost?

Mar 18, 2011

I just installed a fresh copy of debian (no GUI). I want all my traffic on bash (such as when I do ping or dig or wget, basically whatever) to be sent to localhost:8080. How can I do that? I've a ssh port forward setup that will forward all traffic arriving at my localhost:8080 to another server.

View 4 Replies View Related

Networking :: Route Traffic From A Single Host Through A Specific Interface?

Aug 21, 2010

I have a linux router with 2 physical ISPs and a VPN tunnel that all my traffic passes through. I would like to setup a rule to redirect all traffic from one internal IP address (10.0.0.x) through the physical link only. My current script is as follows.

iptables -F
iptables -X
echo 1 > /proc/sys/net/ipv4/ip_forward

[code]....

My goal is to do something similar to the mangle on the tor traffic, but for an entire host.

View 2 Replies View Related

Networking :: Route All Traffic Received By An Interface To Another And Vice Versa?

Mar 2, 2011

The task I am trying to complete is the virtualization of an IPv6 router created using two fedora machines. Here is the physical setup I have now...

PC1:eth0 <------> network
PC1:eth1 <------> PC2:eth0
PC1:eth2 <------> PC2:eth1

PC1 runs radvd to provide router advertisements to the network and a DHCPv6 server for stateful addresses.Each interface is configured on a separate subnet. PC2 runs a DNS server on eth0. PC2:eth1 is used as an IPv6 client for testing purposes. The connections from PC1 to PC2 are just crossover cables.I've created virtual machines of both PCs and have created 4 virtual adapters on the host machine for each of the local-only interfaces.Now I have this:

PC1:eth0 = HOST eth0
PC1:eth1 = HOST vboxnet0
PC1:eth2 = HOST vboxnet1

[code]....

View 2 Replies View Related

Debian Configuration :: VPN PPTP Load On Start And Route All Traffic Through Ppp0?

Mar 28, 2016

I am in serious situation involving PPTP protocol VPN in Debian 8 Jessie stable. I recently became a paid VPN subscriber. Using PPTP; Is there a way to automatically route all traffic through ppp0? Im getting the vpn service killed (ip address goes back to normal unmasked state) whenever there is a power outage (modem reset) and there are alot of those where I live, Im going to get astabilizer and I need a software solution for the situation as well. Theres gotta be a way to route all traffic through the VPN route ppp0 . I tried adding persist and maxfail 0 to the pptp config file but it did not do what i wanted.

Here's my peer configuration file :

pty "pptp blabla.net --nolaunchpppd"
name blablabla
password blablabla
remotename PPTP
file /etc/ppp/options.pptp
require-mppe-128
refuse-eap noauth
persist
maxfail 0

On a second note, its clear to add that I basically need a way to also auto load the line

pppd call blabla.net
and
route add default dev ppp0

On system startup by default so the computer does not use "Wired" connection ^at all^ when not through ppp0. Any other way of not losing VPN anonymity ever due to hardware malfunction.

Is there a way to do this? Ive looked on the net and everything seems like its either from the nineties or can fry my pc , Im no debian expert, less than a year at linux..

Need it to use wired only if ppp0 is being used so if its no vpn, no connection at all period,

View 1 Replies View Related

Networking :: Most Common Method To Route Network Traffic As A Router/proxy

Apr 22, 2011

I am using Debian 5 and I have some networking experience, however I want to learn to do this the best way possible. I have a Debian box with two nics and I want to connect that to a switch and use my Debian box as a router basically, as well as having a firewall setup within that too.

Should I use iptables to set up nat or the route command or what? I just want to know the group of tools to use in order to set up my network. Network diagram: Internet <------> Debian Box <----> switch <----> hosts I found some guides but they are for linux 2.4 and i'm not sure if they are right.

View 1 Replies View Related

Networking :: IPtables: Route Outgoing Traffic From Internal Host To Only Go A Internet Interface?

Nov 21, 2010

My Ubuntu Box has 3 interfaces. eth0 (Internal 192.168.1.0/24)eth1 (External ISP DHCP)eth2 (External ISP Static IP)I need the outgoing traffic to internet for 1 of the internal pc (192.168.1.10) to only go only go through eth2

View 4 Replies View Related

Ubuntu Installation :: Bonding Multiple Wireless NICs?

Nov 20, 2010

I have an Asus R1F laptop with a build in wireless card. I also have 2 USB dongles that we used to use old desktop machines. All of the cards work fine in Ubuntu. I'm running Ubuntu 10.10, 2.6.35-22-generic-pae.

The problem is that I have really bad signal on my side of the house and the connection is dropped quite often. I've tried just connecting on the devices at the same time, they all connect fine but nothing actually works. I read about bonding interface cards on this blog and that would solve all my problems - if a usb dongle could act as a backup for when the normal connection is dropped and while it is reconnecting.

I tried what was written and also did some Googling, but every way that I try seems to work fine until 2 wireless devices are bonded. When that happens they both disconnect and reconnect like crazy. This happens both with and without network manager running.

Build in card[wlan0]: Intel PRO/Wireless 3945ABG
USB[wlan1]: Cisco LinkSys Compact Wireless-G USB Adapter
USB[wlan2]: Realtek RTL 818713 WLAN Adapter
I load the module:
Code:
modprobe bonding mode=1 miimon=100 downdelay=200 updelay=200

[Code]...

View 2 Replies View Related

CentOS 5 Networking :: Multiple NICs On The Same Subnet?

Mar 30, 2009

I have a motherboard which has 4 x 1Gbps Ethernet controllers. I would like to use it as a Gateway for my home network. I have a static IP from my ISP which I can use to configure eth0 (I haven't done it yet as the LE-565 is currently sitting behind my Netgear router until I've got DHCP working). I would like to use eth1, eth2 and eth3 for my LAN. How do I set things up so that DHCP is handing out IP addresses on the same subnet (192.168.0.0/24) on all three interfaces?

P.S. I think what I'm asking is: how do I combine all 3 interfaces to behave like a switch (ie. just like my Netgear router)?

View 6 Replies View Related

Fedora Networking :: Multiple NICS In Same Machine In Same Subnet?

Dec 7, 2009

I have a program that attaches to an interface. I can run two copies of the program on two systems (each running one instance), connect it to a switch, say 1.1.1.1 & 1.1.2.1. In this configuration two instances of the program can communicate and everything is fine.Now, to reduce cost, it want to use only one system with two nics connected to the same switch, running two instances of the above program, each instance attached to two interfaces respectively on the system. I have the following settings:

eth1 Link encap:Ethernet HWaddr XXXXXXXXXXXXXXX
inet addr:1.1.1.1 Bcast:1.1.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

[code]....

However I cannot ping one from the other.

Neither "ping -I eth1 1.1.2.1" nor "ping -I eth2 1.1.1.1" works.

View 2 Replies View Related

Ubuntu :: Conky For Network Traffic Based On Time

Dec 11, 2010

I have installed conky from soft manager after knowing its power today. I'm using 10.10. I want to design a conky script which monitor the network traffic ie total upload + download on monthly basis as I'm on limited internet plan which is too common here. I have free usage from 2am to 8am in the morning and want to exclude this traffic. So I'm in search of a custom script which can accomplish this.

View 1 Replies View Related

Networking :: Shaping Traffic Based On Connection?

Sep 24, 2010

I want to explicitly commit bandwidth to only 3 VOIP connections, where a connection is defined as a source IP address, destination IP address, and a traffic class. I would like the traffic controller to put the first 3 VOIP connections into 3 different queues that would have equal priorities that are higher than Best Effort. If a 4th VOIP connection were to start, its packets would be put into the Best Effort queue. When one of the VOIP connections ends, I would like the incoming packets of a VOIP connection that is in the Best Effort queue (assuming there is one) to now start going into the free VOIP queue. Is it possible to do this? Can traffic control keep track of connections being created and deleted like that? If so, how is it done? I would like to avoid having to be constantly updating my filters whenever a connection starts/ends. In actuality, I would want to do this for several different classes.

View 2 Replies View Related

CentOS 5 Networking :: Multiple NICS In Same Machine Connected To The Same Switch?

Dec 8, 2009

I have a program that attaches to an interface. I can run two copies of the program on two systems (each running one instance), connect it to a switch, say 1.1.1.1 & 1.1.2.1. In this configuration two instances of the program can communicate and everything is fine.

Now, to reduce cost, it want to use only one system with two nics connected to the same switch, running two instances of the above program, each instance attached to two interfaces respectively on the system. I have the following settings:

eth1 Link encap:Ethernet HWaddr XXXXXXXXXXXXXXX
inet addr:1.1.1.1 Bcast:1.1.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth2 Link encap:Ethernet HWaddr XXXXXXXXXXXXXXX
inet addr:1.1.2.1 Bcast:1.1.2.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

[Code]...

View 6 Replies View Related

Networking :: (Debian) IP Traffic Shaping Based On IP/subnets?

Dec 27, 2010

We have a need to shape outgoing traffic EXCEPT to certain IP/subnets (sounds opposite to the title, but not really :P), using iptables if possible. We've had decent luck doing it with various things, but one of the big problems is the decrease in download speed (which DOES NOT need to be shaped at all) due to upload shaping. ie, we want the shaping not to apply to TCP/UDP overhead. Semi related but probably not important is the ability to shape virtualised systems as well (ie the guests), but as the guest traffic goes through the host any traffic shaping done on/to the host should affect the guests as well.

View 1 Replies View Related

Networking :: Port Based Routing For Local Traffic?

May 24, 2009

I have problem with port based routing for local traffic. I can't use trick with iptables -t mangle, ip route table 1, ip rule fwmark table 1 because it works only with forwarded packets. I can't even use patch-o-matic because it's obsolete. And xtables-addons doesn't contain support for "-j ROUTE" yet.

View 2 Replies View Related

Debian Installation :: Get Preseed Working On A Bunch Of Machines With Multiple NICs?

Mar 15, 2011

I am trying to get preseed working on a bunch of machines with multiple NICs but it doesn't pick the right interface and/or gets "no link" on all interfaces. My PXE kernel line looks like so (I have auto=true priority=critical and interface=auto)

label squeeze
kernel debian-installer/squeeze/i386/linux
append vga=788 initrd=debian-installer/squeeze/i386/initrd.gz auto=true priority=critical ramdisk_size=10800 root=/dev/rd/0 rw url=example.com/d-i/squeeze/preseed.cfg interface=auto netcfg/dhcp_timeout=60

[Code]...

View 13 Replies View Related

Server :: PPTP Traffic - Gre Traffic Is Being Generated During The Browsing / Reduce Traffic

Sep 27, 2009

Recently I notice that when I'm connected to an vpn server (pptpd) and I'm using it as a default gateway my download and upload speed decreases almost to the half of the usual speed. I made a test using iptables in order to count how much GRE packets are generated (except the real traffic itself) in that way:

Code:
iptables -I INPUT -p gre -j ACCEPT
iptables -I OUTPUT -p gre -j ACCEPT

iptables -I FORWARD -s 172.16.10.101 -j ACCEPT
iptables -I FORWARD -d 172.16.10.101 -j ACCEPT
The first 2 rules match all GRE packets between the pptpd server and client, and the next rules - the traffic between the server and the client.

When I turn the counters to zero and begin to generate traffic (to browse, to download etc.) I see that the GRE packets are even more than these in the FORWARD chain.

So, my question is first of all is my test correct and is it true that so much gre traffic is being generated during the browsing (it becames clear that the traffic is double than if the pptpd wasn't used as a gateway) and if yes - can that traffic be reduced?

View 3 Replies View Related

Networking :: Splitting The Traffic On Multiple Interfaces?

Jul 6, 2010

I have the following setup: Client A, having 2 network interfaces, eth0 and eth1, both with the IP address 192.168.1.1/32. Client B, also having 2 network interfaces, eth0 and eth1, with the IP addresses 192.168.1.2. The routing table on client A has one entry: 192.168.1.2 dev eth0 The routing table on client B has one entry: 192.168.1.2 dev eth1. Basically the idea is to send the upload traffic one one interface and the download traffic on the other interface. (Client B could serve as a gateway). However, with this setup, well... nothing works. The packets received by Client B are ignored. Does the linux kernel have anything against routing packets coming from an interface, although he thinks the source is on another interface?

View 4 Replies View Related

Applications :: Route Ssh Sessions From A Single Head Node To Multiple Slave Nodes?

Apr 7, 2010

My requirement is to route ssh sessions from a single head node to multiple slave nodes. So what i want is, for a client there is just one point of entry (master/head node) to ssh into, it evaluates the load on the slave nodes connected on to internal network and routes the ssh session, kind of a ssh load balancer. what open source solution i can apply for my problem?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved