Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Feb 2003 11:08:42 +0200 (EET)
From:      root@ghost.odessos.org
To:        freebsd-questions@freebsd.org
Subject:   how to change ip packets source address
Message-ID:  <Pine.LNX.4.44.0302151107270.10101-100000@ghost.odessos.org>

next in thread | raw e-mail | index | archive | help
    Hello,

Sorry if there is a repost, but i did not receive the previous message in my mailbox

    I have a FreeBSD box with three nicks.
ed0 is xxx.xxx.30.198/27
rl1   is xxx.xxx.5.130/30
and rl0 is a private network 192.168.100.1/24
The default gateway is xxx.xxx.5.129
This gateway is configured to only route packets from xxx.xxx.30.192/27
and ed0 is the gateway for the xxx.xxx.30.192/27 network.
For this network everything is ok, the hosts can access the internet
and all the other services. The problem is with this particular machine
and the private network behind it. All traffic from these hosts is with source
address xxx.xxx.5.130 and therefore it is not routed through the default
gateway. For now they can access the internet using a proxy server on
the xxx.xxx.30.192/27 network.
How can I change the source address of the ip packets, so it seems as
they are coming from xxx.xxx.30.198 and not from xxx.xxx.5.130?
I have read the man pages for ipfw and natd but couldn't seem to find
the answer. I'm running a very basic firewall and doing natd over ed0.

Bellow is the firewall list

cyberzone# ipfw show
00050 2281651 1184079986 divert 8668 ip from any to any via ed0
00100    1894     114530 allow ip from any to any via lo0
00200       0          0 deny ip from any to 127.0.0.0/8
00300       0          0 deny ip from 127.0.0.0/8 to any
65000 6756119 3208623388 allow ip from any to any
65535       2        130 deny ip from any to any

natd is started with the following options:

cyberzone# cat /etc/natd.conf
use_sockets yes
same_ports yes
unregistered_only yes

A friend of mine told me about this situation in linux and that it is easily
done with something like:

ip route add default via xxx.xxx.5.129 src xxx.xxx.30.198

Is there something similar in FreeBSD?

Thanks in advance.


please CC any replies to cyberzone@odessos.org because I am
not subscribed to the list.



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.44.0302151107270.10101-100000>