Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Multiple IP addresses
PostPosted: Wed Jan 26, 2011 11:48 am 
Offline
Junior Member

Joined: Sat Sep 18, 2010 7:49 pm
Posts: 24
I read this http://library.linode.com/networking/configuring-static-ip-interfaces/ and set up two IP addresses on my linode.
But now what? is it possible to set up firewall rules based on incoming IP address?

is it possible to dedicate a service to an ip? so if you port scanned one IP only certain ports would appear open?[/url]


Top
   
 Post subject:
PostPosted: Wed Jan 26, 2011 12:05 pm 
Offline
Senior Member
User avatar

Joined: Tue Mar 17, 2009 5:11 am
Posts: 129
Location: UK
Yes you can set a service to run on a particular IP - apache, mysql and SSH all spring to mind. Check their config files to set which IP they listen on.

As you mention firewall you could do port-forwarding from 1 ip address to another, but I'd personally configure the service to run on a certain IP address instead as mentioned above.


Top
   
 Post subject:
PostPosted: Thu Jan 27, 2011 4:33 am 
Offline
Senior Member

Joined: Sat May 03, 2008 4:01 pm
Posts: 569
Website: http://www.mattnordhoff.com/
Yes, iptables supports IP-specific firewall rules. It's possible some frontends don't, but most do.

As for your application question, most do support binding to specific IPs. Check the configuration documentation. Some software doesn't have that feature, of course, in which case it would probably be easiest to let it listen on whatever it wants to but firewall off the other IPs, knowing that the service would be accessible on the other IP if something happened to your firewall.

Why do you care about running different services on different IPs, though?

_________________
Matt Nordhoff (aka Peng on IRC)


Top
   
 Post subject:
PostPosted: Wed Feb 16, 2011 4:00 pm 
Offline
Junior Member

Joined: Sat Sep 18, 2010 7:49 pm
Posts: 24
The reason I am interested in this is because having a webserver opens you up to a ton of break in attempts daily. It would be great if I could have a special IP that only appeared to have a webserver running, and another IP for everything else such as ssh, etc.

does anybody know if it can be done with UFW, or a good document on how to do it with iptables? i am missing some of the search vocabulary to locate the document myself.


Top
   
PostPosted: Wed Feb 16, 2011 4:09 pm 
Offline
Junior Member
User avatar

Joined: Thu Apr 23, 2009 2:32 am
Posts: 41
Website: http://www.linode.com/
Being on the Internet opens a server up to compromise attempts. Botnets routinely perform service scans against very large IP ranges, which costs the controllers nothing (since they aren't paying for the resources anyhow). If you're concerned about such attempts, you may wish to investigate using SSH keys and disabling password access, or using something like DenyHosts or fail2ban.


Top
   
 Post subject:
PostPosted: Wed Feb 16, 2011 5:29 pm 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
1, 2, or 20 IP's it's still the SAME box.

Don't waste public IP's on something as useless as "security thru obscurity".


Top
   
 Post subject:
PostPosted: Wed Feb 16, 2011 11:06 pm 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
vonskippy wrote:
1, 2, or 20 IP's it's still the SAME box.

Don't waste public IP's on something as useless as "security thru obscurity".


While I do agree that by itself, splitting services like this is a "security thru obscurity" argument, it does have a certain merit if used as described above.

Assume my box has 2 IPs. I setup my web server on one IP, setup DNS to point all my domains at that IP. Then, I limit my ssh server to only listen on the other IP. The SSH server is still locked down to only allow key-based auth, not allow root login, etc etc.

With a setup like that, you are just as vulnerable to the random IP sweeping, but your vulnerability to those sweeps, since your ssh is key only, and you keep your web server up to date, is pretty close to zero.

The benefit to splitting the services is that Mr. Angry Hacker, having been offended by your inflammatory blog posts, has almost zero chance at discovering your second IP, cutting in half the number of services he can attempt to exploit as a method of harming your box.


Top
   
 Post subject:
PostPosted: Wed Feb 16, 2011 11:36 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Or you could just ensure you have a static ip and use iptables to block ssh connections from all but that ip.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Wed Feb 16, 2011 11:47 pm 
Offline
Senior Member

Joined: Mon Jul 05, 2010 5:13 pm
Posts: 392
Except I admin my server from my house, and from my netbook or phone on the go.


Top
   
 Post subject:
PostPosted: Thu Feb 17, 2011 12:21 am 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
Drop all external SSH access and use a VPN. Lets see the mean old hacker bypass that.


Top
   
 Post subject:
PostPosted: Thu Feb 17, 2011 10:26 am 
Offline
Senior Member

Joined: Sat Feb 14, 2009 1:32 am
Posts: 123
I have a separate Linode for remote access. Allows SSH access on port 443 (to bypass firewalls) with port tunneling directed to a local instance of Squid. All my servers have SSH bound to the private 192 address and the firewall blocks access that isn't from my remote access server. Then I tell PuTTy to use a proxy and SSH to the private address. I remove the extra service from the public IP and can still access my server from anywhere.


Top
   
 Post subject:
PostPosted: Thu Feb 17, 2011 8:46 pm 
Offline
Senior Member

Joined: Wed Jul 21, 2010 8:04 pm
Posts: 119
Forgive me if I'm wrong, but if you're using key-based authentication, aren't the chances of someone hacking into your Linode via SSH extremely low?


Top
   
 Post subject:
PostPosted: Thu Feb 17, 2011 8:52 pm 
Offline
Senior Member

Joined: Fri Dec 07, 2007 1:37 am
Posts: 385
Location: NC, USA
jzimmerlin wrote:
Forgive me if I'm wrong, but if you're using key-based authentication, aren't the chances of someone hacking into your Linode via SSH extremely low?


+1

I'd be a lot more worried about the bad guys hacking a webserver than a decently-configured sshd. Wasting a second IP for this is silly at best.


Top
   
 Post subject:
PostPosted: Thu Feb 17, 2011 9:20 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
dmwilliams wrote:
does anybody know if it can be done with UFW, or a good document on how to do it with iptables? i am missing some of the search vocabulary to locate the document myself.

It's always a good idea to configure your services so that they only listen on the IP address they're supposed to listen on in the first place, rather than having them listen on all IPs and using a firewall to block them.

If you want to use Ubuntu's UFW (which is one of the easiest firewall tools out there), just apt-get install it and run the following commands:
Code:
sudo ufw allow from any to 12.34.56.78 port 22
sudo ufw allow from any to 98.76.54.32 port 80
sudo ufw allow from any to 98.76.54.32 port 443
sudo ufw default deny
sudo ufw enable

The first line allows SSH on 12.34.56.78. The next two lines allow HTTP and HTTPS on 98.76.54.32. The fourth line disallows everything else, and the fifth line activates the firewall. Change to fit your needs. If you accidentally lock yourself out, go to Lish and try again.


Top
   
 Post subject:
PostPosted: Sun Feb 20, 2011 1:11 am 
Offline
Junior Member

Joined: Sat Sep 18, 2010 7:49 pm
Posts: 24
I am not using public private key authentication, I must just use regular passwords.
I host a subversion server via svn+ssh://
and it is very difficult to configure the subversion clients to use the keys.

Right now I am filtering IP addresses.
And I just got the multiple IP address thing working by binding IP addresses within the config of each service. It works pretty well.

Its really cool, now somebody can't ping my domain and look at the IP address, then try and tamper with my ssh because they don't like my website. I'll be monitoring the number of ssh brute force attempts and see how much less it is then before.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group