Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
routing to machine with real IP address from NAT [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
psih128
n00b
n00b


Joined: 04 Mar 2006
Posts: 47

PostPosted: Wed Jan 17, 2007 12:33 am    Post subject: routing to machine with real IP address from NAT [Solved] Reply with quote

I've been configuring my gentoo box as web/file server for a while. Today I finally got a real IP address from my ISP and I changed /etc/conf.d/net with provided data (IP address is static e.g. gateway, netmask and ip address in /etc/conf.d/net)

my work box is behind NAT (I guess its correct to say so) has a static internal IP address and different gateway and netmask. after restarting eth interface everything works fine, except when I connect linux box from my work computer - connection goes thru internet with a serious lag (I got low bandwidth) instead of flowing thru lan.

How can I configure linux (or maybe windows) to make connection from work machine to my linux box go thru lan.
Both computers are connected to the same switch.

Thanks
Anton


Last edited by psih128 on Fri Jan 19, 2007 6:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Wed Jan 17, 2007 1:51 am    Post subject: Reply with quote

I think there is a problem with your network topology if you have 2 machines on the same switch, and one is behind a NAT router, and the other is not.

Could you draw a diagram of what your setup looks like ?
Back to top
View user's profile Send private message
psih128
n00b
n00b


Joined: 04 Mar 2006
Posts: 47

PostPosted: Wed Jan 17, 2007 2:55 am    Post subject: Reply with quote

My ISP gave me a cable which is connected to my switch. What is on the other end of the cable - I don't know.
On my end I have 2 computers and a set of settings: for each of them:
* ip address
* gateway
* net mask
[*] dns server

all the settings for both comps are different, including net mask. That's why I guess the traffic does not go thru LAN
do you still need a diagram or something else?
Back to top
View user's profile Send private message
cyrillic
Watchman
Watchman


Joined: 19 Feb 2003
Posts: 7313
Location: Groton, Massachusetts USA

PostPosted: Wed Jan 17, 2007 3:15 am    Post subject: Reply with quote

psih128 wrote:
all the settings for both comps are different, including net mask.

I am no networking guru, but I think 2 computers on the same switch should be sharing the same gateway and netmask settings.
Back to top
View user's profile Send private message
psih128
n00b
n00b


Joined: 04 Mar 2006
Posts: 47

PostPosted: Wed Jan 17, 2007 3:41 am    Post subject: Reply with quote

obviously it is not a must, since I have 2 computers with different gws and netmasks connected to the same switch, but they dont share stuff =( intuitively I understand what's happening - my NATed machine can not resolve the IP address locally and looks for it thru its gateway on the internet.
But Im shure there is a way to configure it properly.
Back to top
View user's profile Send private message
neocui
Apprentice
Apprentice


Joined: 21 Apr 2003
Posts: 186

PostPosted: Wed Jan 17, 2007 7:31 am    Post subject: Reply with quote

So I assume your switch is also connected to a router/nat box which is connected to the internet through a different path?
Back to top
View user's profile Send private message
psih128
n00b
n00b


Joined: 04 Mar 2006
Posts: 47

PostPosted: Wed Jan 17, 2007 8:32 am    Post subject: Reply with quote

Yes. I have 3 cords in my switch: 1 from my ISP (I don't know how it is configured on their end) and 2 from my computers with different gateways and netmasks, so the traffic flows thru routers of my ISP, which is no good
Back to top
View user's profile Send private message
dspahn
Guru
Guru


Joined: 22 Jun 2006
Posts: 392

PostPosted: Wed Jan 17, 2007 1:06 pm    Post subject: Just a guess... Reply with quote

Do you have custom port settings on the switch? At my office, we have a setup where many machines are on one switch, but because of the switch configuration, all traffic is routed through the uplink pot that leads to the web filter. That much sounds OK. My guess is that you have a route setup on one of the two boxes that forces information out to the Internet, or that your switch configuration puts everything out to the web before it's allowed in.

Why don't you check your iptables (or whatever firewall rules, as well as your routing table... Let us know if this helps!
Back to top
View user's profile Send private message
psih128
n00b
n00b


Joined: 04 Mar 2006
Posts: 47

PostPosted: Wed Jan 17, 2007 4:43 pm    Post subject: Reply with quote

err...
Actually I even haven't had iptables emerged until now, also I did not care much about firewalling (perhaps it's a bad idea isn't it?)

I'm no good at networking as well as linux networking (I'm no good at linux at all 8)) ) so could you tell me which steps should I take to configure firewall correctly, which firewall should I choose etc.. Anything to begin with.

Also it would be real nice to have a hint what kind of configuration should be performed in order to solve my initial problem

Thanks
Back to top
View user's profile Send private message
neocui
Apprentice
Apprentice


Joined: 21 Apr 2003
Posts: 186

PostPosted: Wed Jan 17, 2007 5:08 pm    Post subject: Reply with quote

Ahh I see.

I wonder if it is possible to create virtual eth devices on both of your machines and give them private IP addresses with the same netmask, so they can talk to each other through the switch. I know VMware can do that for VM's.
Back to top
View user's profile Send private message
psih128
n00b
n00b


Joined: 04 Mar 2006
Posts: 47

PostPosted: Thu Jan 18, 2007 6:40 am    Post subject: Reply with quote

Still I've got no solution :cry:
anybody?
Back to top
View user's profile Send private message
psih128
n00b
n00b


Joined: 04 Mar 2006
Posts: 47

PostPosted: Fri Jan 19, 2007 6:01 pm    Post subject: Reply with quote

Solved by adding another IP address with different netmask using ifconfig.
Thanks for your participation!
Back to top
View user's profile Send private message
psih128
n00b
n00b


Joined: 04 Mar 2006
Posts: 47

PostPosted: Fri Jan 19, 2007 10:32 pm    Post subject: Reply with quote

ok last thing.. how to save god damn ifconfig changes??
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum