Hello there,
I have a peculiar requirement (at least, its peculiar in that I haven’t been able to find a solution myself!!!).
I have a dhcp-client running on a port, it is bridged to other ports connected to devices which we also need to get an IP address from the upstream router.
I also have a couple of WAN aliases on the port on the same subnet as the dhcp-client.
I have NAT masquerading set-up for the LAN (including the bridged clients).
This was set-up in the following order :
- dhcp-client
- additional aliases
For a while the masquerade rule performed as expected, masquerading all outbound traffic to the address obtained via dhcp.
Since a power cut and a subsequent router reboot, one of the aliases has now become the forwarding address.
I’ve tried adding a “to-addresses” value to the masquerade rule which is (probably quite rightly) ignored.
I’ve tried adding a static route to the subnet on the output side, but as there is a dynamic route it takes preference and so the static route is not active.
Some config follows :
# ADDRESS NETWORK BROADCAST INTERFACE
3 192.168.2.101/24 192.168.2.0 192.168.2.255 ether1
4 192.168.2.102/24 192.168.2.0 192.168.2.255 ether1
7 D 192.168.2.242/24 192.168.2.0 192.168.2.255 ether1
and routes as follows :
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 ADS 0.0.0.0/0 192.168.2.1 0
4 ADC 192.168.2.0/24 192.168.2.101 techmedia 0
5 S 192.168.2.0/24 192.168.2.242 ether1 1
I need the forwarded traffic to appear from the source 192.168.242.2 instead of the 192.168.2.101 currently - any ideas how to achieve this?
Many thanks!
Cheers./C.