LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Setting up an Ubuntu router/firewall/server with Webmin and EHCP (https://www.linuxquestions.org/questions/linux-networking-3/setting-up-an-ubuntu-router-firewall-server-with-webmin-and-ehcp-936604/)

cilbuper 03-27-2012 12:58 AM

Setting up an Ubuntu router/firewall/server with Webmin and EHCP
 
Ok, I am in the process of setting up a computer with Ubuntu 10.04 on it with Webmin and EHCP (Easy Hosting Control Panel). I want to set this machine up as a router and web server and make it my firewall as well. I am not going to be hosting anything very sensitive it is more of a testing platform more than anything.

So, I have Webmin installed as well as EHCP and everything is working pretty well. I only have one of the NIC's hooked to the network and it is set by default as DHCP.

I know for a router I need to set one of the NIC's to the inside LAN address. Currently I'm running a WRT54GL router and by default it is 192.168.1.1-254. I would like to set my internal IP on my Linux box to 192.168.1.1 as well but don't know if this is possible while it is still on the same network. Should I just set it to 192.168.2.1 and forget about it?

Now for setting up my WAN IP address, I don't know what to do here. My ISP is Windstream and they gave me a speedstream 4200 which uses 192.168.254.254 as the default IP address, and I think it is in bridged mode so it forwards all external requests to the router.

So now I need to know what I need to set my LAN and WAN NIC to. Do either of these get set to DHCP? I think the linksys WAN connection is set to DHCP so should I set my WAN eth0 NIC to DHCP as well?

So what should I set my internal eth1 NIC to? I would like it to be static and I guess I'll start a 192.168.2.x network.
iface eth0 inet static
address 192.168.2.1
network 192.168.2.0
netmask 255.255.255.0
broadcast 192.168.2.255
????? gateway 192.168.2.1 - or should this be the eth0 adapter?

or

address 192.168.2.1
netmask 255.255.255.0
gateway 192.168.2.1 or should it be the IP of the eth0 adapter and how do I find that if it is set to DHCP?

If the gateway needs to be set to a fixed IP, I know that my Linksys router, being set to DHCP has picked up a 192.168.254.1 IP address, so I could change the eth0 NIC to static and make it the same IP as teh Linksys router has picked up on DHCP.

Now since I am taking the Linksys out as the gateway, I guess this Linux router will have to act as the DNS server so should I install BIND DNS SERVER?

nikmit 03-28-2012 03:11 AM

In most cases the ISP will provide a DHCP address to your WAN interface, and settings for DNS servers and default gateway with it. You don't need to install Bind, and even if you did you will still need to set the forwarding DNS servers on Bind itself. If you don't know what the DNS servers for your provider are you can always use a free public DNS server.

Set your external interface to DHCP, and see if you need to configure the MAC address on it to match the MAC of your current router. Some ISPs lock the connection to one MAC. If you have a static IP from the ISP manually configuring it might work as well.

On the inside you can do more or less whatever you want - pick a subnet and set up DHCP.

Then you need to enable ip_forwarding 'echo 1 > /proc/sys/net/ipv4/ip_forward' and configure NAT (and your firewall?) in iptables.


All times are GMT -5. The time now is 02:10 PM.