Guest Jose Posted May 17, 2003 Report Share Posted May 17, 2003 Hi, I will soon have 5 IP addresses. But I only have one NIC on the computer which will use 4 of the ips. The Linux box will serve as a web server, ftp and maybe dns. Is is possible to point 4 ip addresses to one nic? Quote Link to comment Share on other sites More sharing options...
aru Posted May 17, 2003 Report Share Posted May 17, 2003 Sure you can, search for "virtual hosts". I don't know how to set them for an external interface, you'll probably need to hack a bit with your iptables. Basically, the proccess should be similar to the way is done in a LAN. You have to add aliases to your network interface; ie, in my LAN I've set up 9 virtual hosts for my eth0 interface: /etc# cat /etc/sysconfig/network-scripts/ifcfg-eth0:0 IPADDR="192.168.0.10-19" /etc# So that range of IPs (192.168.0.10-19) are assigned to my eth0 NIC. Then on each machine of my lan I assign each IP to each virtual name.domain.ext; I do this by editing /etc/hosts (I don't use dhcp) Also you have to set the virtual hosts address/name if the server application requires it; ie, apache: /etc# cat /etc/httpd/conf/vhosts/Vhosts.conf [...] <VirtualHost 192.168.0.11> DocumentRoot /home/httpd/public_html/ ServerName www.somename.org ServerAdmin aru@somename.org ErrorDocument 400 /error.php ErrorDocument 401 /error.php ErrorDocument 403 /error.php ErrorDocument 404 /error.php ErrorDocument 500 /error.php </VirtualHost> [...] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.