router/nat with only one NIC
David A. Bandel
david
Wed Sep 8 22:37:59 PDT 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wed, 08 Sep 2004 09:21:14 -0400
Tim Wunder <tim at thewunders.org> wrote:
> Is it possible to route internal internet traffic through a server
> that has only one NIC?
>
> I've only had one PC connected to the internet for quite some time and
>
> have it configured to route all internet traffic through squid,
> squidguard and dansguardian. I want to add a second PC and have its
> internet traffic routed the same way. The server that runs squid and
> dansguardian currently has only one NIC. So far, the information I've
> found on the 'net through googling indicates that I need to have a
> second NIC in order to do this.
>
> Is there a way to do it without adding a second NIC?
Yes, just get a second IP from your provider (and configure the first
server as your proxy) or:
ifconfig eth0:1 192.168.31.1
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 0 > /proc/sys/net/ipv4/conf/eth0/send_redirect
add any firewall stuff you want, plus you'll need:
iptables -t nat -I POSTROUTING -s 192.168.31.0/24 -j SNAT --to-source
xxx.xxx.xxx.xxx
>
> I know... NICs are cheap, just buy a second one. It'll just be a pain
> to have to pull the server out from where it is, then install and
> configure a NIC. I'm trying to avoid that.
>
> Thanks,
> Tim
Ciao,
David A. Bandel
- --
Focus on the dream, not the competition.
Nemesis Racing Team motto
GPG key autoresponder: mailto:david_key at pananix.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBP6Bfj31PLQNUbV4RAj5iAJkBVHHLuU0gcJ5cHhbLf6gXAhZmrgCeOxQb
V/HEz8iIHLDAS7Itv/1s6v4=
=qokF
-----END PGP SIGNATURE-----
More information about the Linux-users
mailing list