You are not logged in.
Hi,
If I may ask for some clarification..
My company is running an openvpn server to which I can connect from home and access their whole network, which is fine.
However, the vpn server at work is also able to access the PC I'm using to connect to the VPN
While connected to the VPN, I ssh'd into the server and tried to access the apache on my vpn IP, to acertain that.
The question is now, is there a way to prevent that from happening?
i.e. I want to be able to connect to work, but I don't want any machine at work to be able to access my home ressources.
I could of course configure apache (and indeed every other daemon I'm running) to listen only to local connections or interfaces, but I'd like to avoid that..
thx
Mat
Offline
There're a lot of things you could do :
-Ask for authentication when trying to connect to your apache;
-Limit the range of IP that can connect;
-etc.
Offline
iptables -I INPUT -i tun0 -m state --state NEW -j REJECTAssuming you're using tun, not tap.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
thanks fukawi, that's exactly what I'm looking for..
my own tries with iptables only led to cutting off all (in and out) vpn traffic.. which was pretty secure though ![]()
Mat
Offline
Yeah, you only want to block the new connections. You could just block SYN packets too, which would achieve the same thing, but without relying on the kernel's state table
iptables -I INPUT -i tun0 --syn -j REJECTAre you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
SYN packets are TCP only, aren't they? (had to google that
)
Since we're using an UDP connection (should have probably mentioned that earlier), your second rule wouldn't work
so, guess the question becomes: is relying on the kernel's state table a bad thing?
I've looked through the iptables manpage and found the INVALID state.. rejecting those packets too should help, right
Mat
Offline
generally what you would do is setup a firewall rule to allow in only related/established traffic, and reject/drop everything else.
iptables -I INPUT -i tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -I INPUT -i tun0 -p icmp -j ACCEPT
iptables -I INPUT -i tun0 -j REJECTEDIT: you should probably also allow icmp packets, so your company network admins can ping your machine and for possible source route updates from internal routers. edited ruleset above.
Last edited by cactus (2010-12-30 21:05:02)
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
Correct the_mat (about TCP and SYN)... And what cactus said is also sound advice, especially about ICMP ![]()
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
great guys, I used cactus' rules and they work as advertised
thanks again and Happy nEw Year ![]()
Offline