Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-20-2013, 08:46 AM
|
#1
|
LQ Newbie
Registered: Oct 2013
Posts: 4
Rep: 
|
Routing between 2 192.168.1.x networks same IP-Adress
Hi group,
I have two 192.168.1.x subnets with its own network cards at an Win7 Host with ubuntu 12 VM.
Ho do I setup routing between those subnets lets say 192.168.1.1 in one network 192.168.1.2 in the other.
Can I manage it with IP-Tables alone or do I need route add xyz also?
Or do I have to use a bridge?
Next If the devices in the subnets have the same IP 192.168.1.1
I have to translate the IP somehow for the other net with DNAT/SNAT?
My main problem is the first how to setup that route.
|
|
|
10-20-2013, 10:10 AM
|
#2
|
Senior Member
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350
Rep: 
|
I'm afraid you're a bit confused here.
"192.168.1.x" is an address not a subnet. (Well, you could subnet it using something like 255.255.255.192 as netmask, but 192.168.1.1 and 192.168.1.2 can not be on different subnets).
Make it easy for yourself:
Subnet 1: 192.168.1.x 255.255.255.0
Subnet 2: 192.168.2.x 255.255.255.0
Then just add routes - necessary only if these networks are not reached via default gateway.
|
|
|
10-20-2013, 10:40 AM
|
#3
|
LQ Newbie
Registered: Oct 2013
Posts: 4
Original Poster
Rep: 
|
But I have the Problem as described and thats why Need more complex setup with IPTables and Alike.
I forgot to mention I can't change the IPSettings of the devices and thats why Need Address Translation and IPTables I know this i Not an usual easy setup.
|
|
|
10-20-2013, 10:58 AM
|
#4
|
Senior Member
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350
Rep: 
|
Hmm... You route between *networks*, not between adresses - maybe there is a way to do that, but I'm beginning to think I misunderstand you.
Can you please give complete details about your setup?
Like this:
Code:
Router1:
nic1= <ip address/netmask>
nic2= <ip address/netmask>
Then the same for your Win7 & Ubuntu.
And your Ubuntu is a guest-VM running on Win7-host, right?
Then tell us what virtualization you're using (VirtualBox, VmWare, Xen...?) and details about the network config for your guest & host.
And how come you can't change the IPSettings?
|
|
|
10-20-2013, 12:01 PM
|
#5
|
LQ Newbie
Registered: Oct 2013
Posts: 4
Original Poster
Rep: 
|
What I Need is catching Traffic for several Ips with on Network card SNAT it and forward it to the other Network card.
I don't know if I have to Set the NIC to Promisc or Set it to multiple IPs i have to catch.
I also don't know If I can Set a Route with iptables alone or have to use Route and can only do Filters for with IPTables.
I havent found a Syntax for Setting from eth0 with destip xy forward to eth1.
If I Set ethx to Promisc where all the Pakets go to then INPUT FORWARD?
Are Packets to non Host IPs dropped by default and I have to overide this?
My Problem should be Doable but I don't know how to Tell the Kernel in detail
|
|
|
10-20-2013, 12:25 PM
|
#6
|
Senior Member
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350
Rep: 
|
I'm sorry I don't understand anything you're saying.
Do you have 192.168.1.1 on one nic and 192.168.1.2 on another?? What system is it you're talking about?
Where do you want to use Iptables/SNAT/route or whatever???
Could you please answer the questions in my previous post?
|
|
|
10-20-2013, 02:11 PM
|
#7
|
LQ Newbie
Registered: Oct 2013
Posts: 4
Original Poster
Rep: 
|
If you don't know IPTables you can't help me anyway, may be somebody hier has some more experience with IP-Tables and can give some hints.
Otherwise I have to try until it works may be I have to research some more days.
Unfortunately I can't find a tutorial answering my questions.
It doesn't matter why my systems are like they do I just have to deal with the way they are.
|
|
|
10-30-2013, 01:10 PM
|
#8
|
Member
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891
Rep: 
|
You problem is your hosts. If you have two 192.168.1.x subnets, with host 192.168.1.1 on one and 192.168.1.2 on the other , and I'm assuming your linux machine is the gateway although you don't say what addesses are assigned to it. You could Source NAT but how sure are you that there is no addressing overlap on the two subnets?
What you really need to do, and what I would do on a router, is to Source and Destination NAT in both directions. So 192.168.1.x (A) appears to 192.168.1.x (B) as 172.16.1.x, then 192.168.1.x (B) appears to 192.168.1.x (A) as 172.16.2.x. You would get this result -
[S:192.168.1.1 - D:172.16.2.2] --> NAT --> [S:172.16.1.1 - D:192.168.1.2]
[S:172.16.2.2 - D:192.168.1.1] <-- NAT <-- [S:192.168.1.2 - D:172.16.1.1]
This way addressing conflicts are irrelevant.
I could do it on a router in ten minutes but not with linux :-( someone better with IPTABLEs should be able to help set this up.
btw, pingu wasn't saying he didn't know iptables, he was saying that you are not being explicit enough about your setup to be able to help you. I've made some assumptions which may be wrong. These problems are complex and while it may seem like stating the obvious to you, you have to state it anyway as WE are not telepathic. Be specific or we can't help no matter how much we want to.
Last edited by baldy3105; 10-30-2013 at 01:15 PM.
|
|
|
All times are GMT -5. The time now is 04:18 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|