I have a RH 7.1 on a PC I use as gateway to internet for a small lan.
So I have:
kernel 2.4.2-2
iptables 1.2.1a
My lan use ip 192.168.0.x
Linux PC has IP 192.168.0.101
Using isdn-config i setup isdn card, added a provider. I setup autodial
also.
I can connect to my provider and navigate Internet.
Then I added the following roule to netfilter:
iptables -t nat -A POSTROUTING -s 192.168.0/24 -o ippp0 -j MASQUERADE
With this I can navigate Internet from my lan.
My problem is that the first request from my lan.
Using tcpdump and adding some rules with target LOG in netfilter I can see
the following:
The request transit the nat PREROUTING chain, then the FORWARD chain and
then the nat POSTROUTING chain. Here the source ip is changed.
Soon after a reboot POSTROUTING chain assign ip 192.168.0.101 as source
IP(ISDN was never connected so there isn't a local IP on interface ippp0),
but when isdn set the local and remote ip of interface ippp0, retrasmit
packets coming from lan are still masquerade with the old IP.
So I have a request going to Internet with source ip 192.168.0.101.
How can I solve this?
Thank in advance
Gelpi ing. Andrea
Trento (Italy)
---------------------------------------------------------------
"It took the computing power of three C-64s to fly to the Moon.
It takes a 486 to run Windows 95. Something is wrong here."
---------------------------------------------------------------
So I have:
kernel 2.4.2-2
iptables 1.2.1a
My lan use ip 192.168.0.x
Linux PC has IP 192.168.0.101
Using isdn-config i setup isdn card, added a provider. I setup autodial
also.
I can connect to my provider and navigate Internet.
Then I added the following roule to netfilter:
iptables -t nat -A POSTROUTING -s 192.168.0/24 -o ippp0 -j MASQUERADE
With this I can navigate Internet from my lan.
My problem is that the first request from my lan.
Using tcpdump and adding some rules with target LOG in netfilter I can see
the following:
The request transit the nat PREROUTING chain, then the FORWARD chain and
then the nat POSTROUTING chain. Here the source ip is changed.
Soon after a reboot POSTROUTING chain assign ip 192.168.0.101 as source
IP(ISDN was never connected so there isn't a local IP on interface ippp0),
but when isdn set the local and remote ip of interface ippp0, retrasmit
packets coming from lan are still masquerade with the old IP.
So I have a request going to Internet with source ip 192.168.0.101.
How can I solve this?
Thank in advance
Gelpi ing. Andrea
Trento (Italy)
---------------------------------------------------------------
"It took the computing power of three C-64s to fly to the Moon.
It takes a 486 to run Windows 95. Something is wrong here."
---------------------------------------------------------------