View previous topic :: View next topic |
Author |
Message |
clerus21 Apprentice
Joined: 20 Aug 2003 Posts: 196 Location: uruguay
|
Posted: Wed Aug 20, 2003 1:15 am Post subject: iptables masquerading |
|
|
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 |
|
|
splooge l33t
Joined: 30 Aug 2002 Posts: 636
|
Posted: Wed Aug 20, 2003 2:49 am Post subject: |
|
|
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 |
|
|
clerus21 Apprentice
Joined: 20 Aug 2003 Posts: 196 Location: uruguay
|
Posted: Wed Aug 20, 2003 3:00 am Post subject: |
|
|
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 |
|
|
Decibels Veteran
Joined: 16 Aug 2002 Posts: 1623 Location: U.S.A.
|
|
Back to top |
|
|
To Veteran
Joined: 12 Apr 2003 Posts: 1145 Location: Coimbra, Portugal
|
Posted: Wed Aug 20, 2003 9:20 am Post subject: |
|
|
The command can be simplified and use just this: Code: | iptables -A POSTROUTING -t nat -o ppp0 -j MASQUERADE |
That's it.
Tó _________________
------------------------------------------------
Linux Gandalf 3.2.35-grsec
Gentoo Base System version 2.2
------------------------------------------------ |
|
Back to top |
|
|
clerus21 Apprentice
Joined: 20 Aug 2003 Posts: 196 Location: uruguay
|
Posted: Thu Aug 21, 2003 12:42 am Post subject: |
|
|
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 |
|
|
splooge l33t
Joined: 30 Aug 2002 Posts: 636
|
Posted: Thu Aug 21, 2003 2:40 am Post subject: |
|
|
Do the link lights turn on on your network cards? _________________ http://get.a.clue.de |
|
Back to top |
|
|
|