Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Nov 11, 2007 11:01 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
At home I use virtual servers as "bastion hosts". So my web server is on one vhost, the mail server on another, and so on. Up until now I've been using vserver but I'm migrating to a newer bigger machine and don't want to deal with maintaining my own host kernel, which might cause host OS interaction issues. So I'm wanting to rebuild using UML.

I've mostly got it working, but I'm not happy with the security of the networking.

I've tried using tuntap thus:
Code:
brctl addif br0 eth0
ifconfig br0 10.10.10.100 up
int=`tunctl -b`
brctl addif br0 $int
linux .... eth0=tuntap,$int ....


This works and the UML can set an IP address and sees the network. BUT.. the vhost decides on the IP address. If someone _did_ manage to break into the vhost then they could disrupt other servers by changing IP address.

I looked at http://user-mode-linux.sourceforge.net/ ... rking.html but none of the options there appear to work well... OR I'm making a mistake!

Does anyone know a secure way of forcing the client to have a specific IP address on a bridged network?

Thanks!

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
 Post subject:
PostPosted: Mon Nov 12, 2007 11:42 am 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
Short answer: ebtables to filter MAC, ARP and IPv4.

-Chris


Top
   
 Post subject:
PostPosted: Mon Nov 12, 2007 12:50 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
ebtables? Hmm, never heard of that... googlegooglegoogle. Ah, filtering at the ethernet level.

Interesting.

Do we need to go to that level, or could we use iptables "physdev" module, as described in http://www.linuxjournal.com/comment/reply/9421 ?

eg
Code:
iptables -A FORWARD -m physdev --physdev-in tap0 -s ! 10.1.1.10 -j DROP


Or does that still leave me open to spoofing?

Otherwise, could I bug you for a longer answer on how to use ebtables? Thanks!

_________________
Rgds

Stephen

(Linux user since kernel version 0.11)


Top
   
 Post subject:
PostPosted: Mon Nov 12, 2007 12:58 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
( silly question deleted... that didn't work )

_________________
Rgds

Stephen

(Linux user since kernel version 0.11)


Last edited by sweh on Mon Nov 12, 2007 1:31 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Mon Nov 12, 2007 1:30 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
Hmm, the obvious command didn't work. A tcpdump on the host shows that's cos it doesn't allow ARP to work (lots of "who is" requests). But this seems to work:
Code:
ebtables -A FORWARD -i tap0 --among-src E6:EF:3B:43:11:11=10.0.0.250 -j ACCEPT
ebtables -A FORWARD -i tap0 -j DROP


Quick tests seem to mean that if the guest tries to change MAC or IP addresses then traffic out is blocked. So this looks good.

Am I missing anything else?

_________________
Rgds

Stephen

(Linux user since kernel version 0.11)


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


Who is online

Users browsing this forum: apkehoe 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