Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables masquerading
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
clerus21
Apprentice
Apprentice


Joined: 20 Aug 2003
Posts: 196
Location: uruguay

PostPosted: Wed Aug 20, 2003 1:15 am    Post subject: iptables masquerading Reply with quote

Hi I have just installed gentoo linux (1.4_rc4) using vanilla-sources , anda my problem is that i need to give internet acces to another computer runing windows Me, my pc has 2 network cards and with Suse linux I had no problems doing this with this commadns:
/sbin/iptables -t nat -A POSTROUTING -p all -s 192.168.0.0/24 -d ! 192.168.0.0/24 -j MASQUERADE -o ppp0

echo 1 > /proc/sys/net/ipv4/ip_forward

but in gentoo even though the commands seem to work fine, nothing happends, I mean my win pc cannot connect to the internet, it cant even ping 192.168.0.1, which is the ip of my network card connected to the win pc, Iam acting as a gateway
I thought It could be that somemodules were not compiled in the kernel, but I am pretty sure thats not the problem...
Since I cant even ping the gateway I thought that maybe ipforwarding was not enable but I enabled it in sysctl.conf and i didnt work
Please help me
thanxz
Back to top
View user's profile Send private message
splooge
l33t
l33t


Joined: 30 Aug 2002
Posts: 636

PostPosted: Wed Aug 20, 2003 2:49 am    Post subject: Reply with quote

If you can't ping it's not an iptables problem (well it could be, but your config there doesn't specifically block pings..)

What does ifconfig have to say about the issue? Do you get a link light on your nic and/or hub? What's the IP address of the windows box?
_________________
http://get.a.clue.de
Back to top
View user's profile Send private message
clerus21
Apprentice
Apprentice


Joined: 20 Aug 2003
Posts: 196
Location: uruguay

PostPosted: Wed Aug 20, 2003 3:00 am    Post subject: Reply with quote

I donnot use a hub just a "crossover" or something like that cable
this is my ifconfig:

eth0 Link encap:Ethernet HWaddr 00:08:A1:31:C2:5B
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:306 errors:0 dropped:0 overruns:0 frame:0
TX packets:243 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:21466 (20.9 Kb) TX bytes:10206 (9.9 Kb)
Interrupt:10 Base address:0xdc00

eth1 Link encap:Ethernet HWaddr 00:10:B5:0E:FC:FC
inet addr:207.170.82.202 Bcast:207.0.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1215 errors:0 dropped:0 overruns:0 frame:0
TX packets:1206 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1450298 (1.3 Mb) TX bytes:102555 (100.1 Kb)
Interrupt:9 Base address:0xf00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:178 errors:0 dropped:0 overruns:0 frame:0
TX packets:178 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7836 (7.6 Kb) TX bytes:7836 (7.6 Kb)

ppp0 Link encap:Point-to-Point Protocol
inet addr:200.71.8.77 P-t-P:200.71.8.1 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:1160 errors:0 dropped:0 overruns:0 frame:0
TX packets:1164 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:1421414 (1.3 Mb) TX bytes:74359 (72.6 Kb)

I think it can be an ipforwarding issue

and my windows box ip adress is 192.168.0.3
and my linux box which acts as a gateway is 192.168.0.1


Last edited by clerus21 on Wed Aug 20, 2003 3:06 am; edited 1 time in total
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1623
Location: U.S.A.

PostPosted: Wed Aug 20, 2003 3:05 am    Post subject: Reply with quote

Try here and see if any of this helps you.

http://webpages.charter.net/decibelshelp/LinuxHelp_ICS_Install.html#ICS_Install

and

http://webpages.charter.net/decibelshelp/LinuxHelp_IPtables.html#ip_masq
Back to top
View user's profile Send private message
To
Veteran
Veteran


Joined: 12 Apr 2003
Posts: 1145
Location: Coimbra, Portugal

PostPosted: Wed Aug 20, 2003 9:20 am    Post subject: Reply with quote

The command can be simplified and use just this:
Code:
iptables -A POSTROUTING -t nat -o ppp0 -j MASQUERADE

That's it.


_________________

------------------------------------------------
Linux Gandalf 3.2.35-grsec
Gentoo Base System version 2.2
------------------------------------------------
Back to top
View user's profile Send private message
clerus21
Apprentice
Apprentice


Joined: 20 Aug 2003
Posts: 196
Location: uruguay

PostPosted: Thu Aug 21, 2003 12:42 am    Post subject: Reply with quote

Iam recompiling the kernel right now and iam gonna try to do things like in the pages that u gave me above, but i dont know if this will work couse i think my problem is that my two computers dont see each other, I cant ping from my win box to my linux box ( the gateway) I think my problem is there...
I will let u know
thanxz for everything
Back to top
View user's profile Send private message
splooge
l33t
l33t


Joined: 30 Aug 2002
Posts: 636

PostPosted: Thu Aug 21, 2003 2:40 am    Post subject: Reply with quote

Do the link lights turn on on your network cards?
_________________
http://get.a.clue.de
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