Re: Forcing a default IP address on multi-homed host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11 Jun 2002, Simon Gornall wrote:

> What I'm after is to say to the machine somehow "when you source packets
> to the internet, use the public address, not the private one". Is there
> a way of doing this in 2.2 ? It seems to me that iptables NAT might be
> able to do it, but I can't find anything for 2.2 that can modify source
> packets outwards - sort of reverse-nat....

Have a look at the "ip" command (part of iproute2).

With this instead of the old "route" command, you can setup your routes
and name a specific source-ip to be used.

"ip route add default via 192.168.23.42 dev eth0 src 172.16.2.3"

c'ya
sven

-- 

The Internet treats censorship as a routing problem, and routes around it.
(John Gilmore on http://www.cygnus.com/~gnu/)

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux