Networking Forums

Networking Forums > Computer Networking > Linux Networking > question on dual NIC in linux

Reply
Thread Tools Display Modes

question on dual NIC in linux

 
 
zhouxf
Guest
Posts: n/a

 
      02-09-2006, 11:16 AM

I set NIC as:
eth0:135.252.111.11
eth1:135.252.222.22
they both work.

I want to bind ssh on eth0, bind SIP traffic on eth1, then I set ssh to
listen on 135.252.111.11, bind the socket of SIP on 135.252.222.22.
But use tcpdump can get the packet on eth1, though ssh address is
135.252.111.11.

Is that becase linux get the best route for it? how to disable the function
of this,
I want to make all ssh packet on eth0, even from 135.252.222.*

thanks a lot!
Zhou, Xiaofang


 
Reply With Quote
 
 
 
 
Eric Lalitte
Guest
Posts: n/a

 
      02-10-2006, 09:28 AM
"zhouxf" <(E-Mail Removed)> wrote in message
news:dsfbrm$(E-Mail Removed)
> I set NIC as:
> eth0:135.252.111.11
> eth1:135.252.222.22
> they both work.


Hum, you must give also the network masks if you want us to know which
networks you're talking about.

> I want to bind ssh on eth0, bind SIP traffic on eth1, then I set ssh to
> listen on 135.252.111.11, bind the socket of SIP on 135.252.222.22.
> But use tcpdump can get the packet on eth1, though ssh address is
> 135.252.111.11.
> Is that becase linux get the best route for it? how to disable the function
> of this,
> I want to make all ssh packet on eth0, even from 135.252.222.*


Well, you seem tu use SSH as a server. Though, any connection to your
machine is set by another machine, the client.
If there is anyway for the client on network 135.252.222.??? to get
to network 135.252.111.??? without having to pass by 135.252.222.22,
then you could do what you want with forcing the routing tables on
every clients.
Something like "route add -host 135.252.111.11 gw 135.252.222.??"
could do the trick.
Also, you'll have to set a special route on the server to go back
through eth0 when you reply.

This could be done, but is surely ugly :-)




--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
 
Reply With Quote
 
zhouxf
Guest
Posts: n/a

 
      02-11-2006, 02:19 AM
thanks, I get what you mean
netmask is 255.255.255.0
client on 135.252.222.* can route to 135.252.111.* by other gateway and
switch

But I can not know who will use ssh to access my linux, so I can not set the
route in advance.
So my question is how to disconnect the route between eth0 and eth1 on my
linux?

Zhou, Xiaofang



 
Reply With Quote
 
Eric Lalitte
Guest
Posts: n/a

 
      02-11-2006, 10:05 AM
"zhouxf" <(E-Mail Removed)> wrote in message
news:dsjl4o$(E-Mail Removed)
> But I can not know who will use ssh to access my linux, so I can not set the
> route in advance.
> So my question is how to disconnect the route between eth0 and eth1 on my
> linux?


A firewall can do the trick, but will stop the traffic.
Put an iptable rule like:
iptables -A INPUT -i eth1 -s 135.252.222.0/24 -d 135.252.111.11 -j DROP

Another solution would be to use iproute2 on 135.252.111.11 in order to
route any traffic from 135.252.222.0/24 to the other gateway.
You first have to add a new routing table name, take care that this
routing
table have to be used before the local one which id is 0...:
# echo 201 table_name >> /etc/iproute2/rt_tables
Then add a rule to the table:
# ip rule add from 135.252.222.0/24 lookup table_name
And put a unique route for 135.252.111.11 in this table:
# ip route add 135.252.111.11 via @other_gateway table table_name

Now, any traffic coming from 135.252.222.0/24 and going to
135.252.111.11 should go back to the other gateway.

I don't know how this solution can be implemented as long as table
local is id 0 and your new table have to be processed before local.
If you can't use negative ids for tables, you might try to change the
id of the local table to anything up to 0, and give the id 0 to your
table. But I don't know what would be the result...



--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual Homed Question DJ Windows Networking 6 02-06-2007 12:44 PM
Dual NIC Card - Question Bluehades Windows Networking 4 10-21-2005 04:02 AM
Dual NIC Question =?Utf-8?B?bXltb2JpbGU=?= Windows Networking 1 03-22-2005 05:11 PM
dual NICs Question =?Utf-8?B?bXltb2JpbGU=?= Windows Networking 0 03-22-2005 02:53 PM
Dual LAN Motherboard for Linux Server Brian Riley Linux Networking 0 02-22-2004 06:13 AM



1 2 3 4 5 6 7 8 9 10 11