LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-14-2014, 02:35 PM   #1
Tenuous
LQ Newbie
 
Registered: Apr 2012
Location: North Carolina
Distribution: RHEL, CentOS, Fedora, Ubuntu, Mint
Posts: 3

Rep: Reputation: Disabled
Question Routing A Single IP Through A Single Interface


Hi. I thought I had a good handle on routing until I tried to do what I thought was a simple task recently. I've tried several different things and meeting with failure. Can any assist?

I want to bring up eth2 to only route traffic intended for xxx.xxx.14.71 and xxx.xxx.14.71 is not a gateway, it's a destination and a single IP on the xxx.xxx.14.0/23 subnet.

I have two subnets:
Code:
xxx.xxx.14.0/23
xxx.xxx.16.0/22
I have 4 interfaces. Ports eth1 and eth3 are bond1.
Code:
bond1     Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          inet addr:xxx.xxx.17.202  Bcast:xxx.xxx.19.255  Mask:255.255.252.0
          inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:120795 errors:0 dropped:0 overruns:0 frame:0
          TX packets:588 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:11043856 (10.5 MiB)  TX bytes:58868 (57.4 KiB)

eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          inet addr:xxx.xxx.14.46  Bcast:xxx.xxx.15.255  Mask:255.255.254.0
          inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2888820 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2241489 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3439168377 (3.2 GiB)  TX bytes:3337328517 (3.1 GiB)
          Interrupt:32

eth1      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:60421 errors:0 dropped:0 overruns:0 frame:0
          TX packets:296 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5524803 (5.2 MiB)  TX bytes:29605 (28.9 KiB)
          Interrupt:36

eth3      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:60374 errors:0 dropped:0 overruns:0 frame:0
          TX packets:292 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:5519053 (5.2 MiB)  TX bytes:29263 (28.5 KiB)
          Interrupt:36
 
Old 11-14-2014, 07:00 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
I'm not quite sure I understand what you're trying to do.

You've assigned the eth0 interface the IP address "xxx.xxx.14.46" and a 23 bit netmask, so the IP stack now knows how to reach any other IP address in the "xxx.xxx.14.0/23" network, including "xxx.xxx.14.71", assuming eth0 is physically connected to the "xxx.xxxx.14.0/23" network, of course.

Are you trying to prevent the host in question from reaching other hosts in the "xxx.xxxx.14.0/23" network? Or do you want it to be able to forward traffic from other hosts/networks to this one specific host, but reject packets for other hosts in the same network?
 
Old 11-14-2014, 07:27 PM   #3
Tenuous
LQ Newbie
 
Registered: Apr 2012
Location: North Carolina
Distribution: RHEL, CentOS, Fedora, Ubuntu, Mint
Posts: 3

Original Poster
Rep: Reputation: Disabled
I want any and only traffic to xxx.xxx.14.71 to only go through eth2. Any other traffic for xxx.xxx.14.0/23 can go through eth0.
 
  


Reply

Tags
routing


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Actual damages for single unauthorized download of software program held to be cost of single LXer Syndicated Linux News 0 12-31-2011 04:01 PM
Single-Window Interface emacs-and-vi Linux - Newbie 3 03-11-2007 05:44 PM
Routing on a single Interface bernard7 Linux - Networking 2 05-01-2006 04:06 PM
problems routing with single NIC bravo_veinticinco Linux - Networking 1 12-16-2005 03:30 AM
Dual IP on a single interface darkknight_9 Linux - Networking 1 11-24-2003 07:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration