Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Forbid eth0 to access 192.168.0.x
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Thu Jun 26, 2003 8:03 pm    Post subject: Forbid eth0 to access 192.168.0.x Reply with quote

How can I do it so my eth0 can't access the 192.168.0.x adresses?
Back to top
View user's profile Send private message
devon
l33t
l33t


Joined: 23 Jun 2003
Posts: 943

PostPosted: Thu Jun 26, 2003 8:05 pm    Post subject: Reply with quote

Without more details, I would say iptables.
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Thu Jun 26, 2003 8:10 pm    Post subject: Reply with quote

No. What happens is that I want to block the access of eth0 before bringing it up... this is because there is a LAN DHCP server running and I want this interface to get IP from the ISP's DHCP server and not from the LAN's DHCP server.
Back to top
View user's profile Send private message
devon
l33t
l33t


Joined: 23 Jun 2003
Posts: 943

PostPosted: Thu Jun 26, 2003 8:32 pm    Post subject: Reply with quote

Quote:
this is because there is a LAN DHCP server running and I want this interface to get IP from the ISP's DHCP server and not from the LAN's DHCP server.
On your LAN DHCP server, would it be possible to configure it so that it ignores DHCP requests from the MAC address of eth0?
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Thu Jun 26, 2003 8:35 pm    Post subject: Reply with quote

Nice idea! I'll try it!

But still I'd like that it would be the client that refuses the server rather than reverse... nevermind... if somebody knows anything, it might be posted :roll:
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Thu Jun 26, 2003 8:48 pm    Post subject: Reply with quote

:!: :!: Problem :!: :!:

How do I tell in dhcpd.conf that I want dhcpd to ignore a determined MAC address? There seems to be no such option in the dhcpd.conf man page... :cry:
Back to top
View user's profile Send private message
devon
l33t
l33t


Joined: 23 Jun 2003
Posts: 943

PostPosted: Fri Jun 27, 2003 1:26 am    Post subject: Reply with quote

Seach the man page for dhcpd.conf for known/unknown hosts. You could probably make a HOST declaration for the server that should not DHCP and then set "ignore known". Something like:
Code:
host nodhcp {
  hardware ethernet <MAC Address>;
}

subnet <IP> netmask <mask> {
   pool {
      options...
       ignore known clients;
   }
}

Also look at /etc/dhcp/dhcpd.conf.sample
Back to top
View user's profile Send private message
cdunham
Apprentice
Apprentice


Joined: 06 Jun 2003
Posts: 211
Location: Rhode Island

PostPosted: Fri Jun 27, 2003 3:22 am    Post subject: Reply with quote

Is this box a bridge/router/firewall between the ISP network and the LAN? If so, you should be able to get DHCP from one interface for the LAN, and another from the ISP on the other interface...
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Fri Jun 27, 2003 6:27 am    Post subject: Reply with quote

cdunham wrote:
Is this box a bridge/router/firewall between the ISP network and the LAN? If so, you should be able to get DHCP from one interface for the LAN, and another from the ISP on the other interface...


This is why I'm doing all this, my dear friend ;)
Back to top
View user's profile Send private message
devon
l33t
l33t


Joined: 23 Jun 2003
Posts: 943

PostPosted: Fri Jun 27, 2003 6:31 am    Post subject: Reply with quote

Does this not work in /etc/conf.d/net?
Code:
iface_eth0="dhcp"
iface_eth1="dhcp"
This assumes your ISP connections plugs directly into either eth0 or eth1 and a switch/hub plugs into the other interface to share the Internet with your client PCs.
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Fri Jun 27, 2003 3:19 pm    Post subject: Reply with quote

Diagram:


1.Athlon XP
eth0 (LAN DHCP SERVER)
eth1 (ISP DHCP)

2.K6-2
eth0 (ISP DHCP)
eth1 (LAN DHCP)

3.Pentium-IV
eth0 (LAN DHCP)


So 1.eth1 and 2.eth0 have to get DHCP IP from ISP.
1.eth0 is the LAN DHCP SERVER while 2.eth1 and 3.eth0 are LAN DHCP CLIENTS.

This happens because my ISP gives only 2 IP address for a single connection (won't enter on hardware configuration details), so the other interfaces with LAN IP must access the internet through the 1.eth1 gateway (although 2.eth1 won't use it as there is already such access). Nevermind, I'll configure dhcp server to ignore 2.eth0.

This topic is related with this one too (perhaps a moderator could merge both themes or so...) https://forums.gentoo.org/viewtopic.php?t=63498&start=0&postdays=0&postorder=asc&highlight=

This is because linux cuts gateway connection (while windowz doesn't) while there's inactivity. It's not totally related with this topic but it's the same interface on the same computer.
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Fri Jun 27, 2003 3:25 pm    Post subject: Reply with quote

devon wrote:
Does this not work in /etc/conf.d/net?
Code:
iface_eth0="dhcp"
iface_eth1="dhcp"
This assumes your ISP connections plugs directly into either eth0 or eth1 and a switch/hub plugs into the other interface to share the Internet with your client PCs.


No... it isn't like that. Look:

1.eth0, 1.eth1, 2.eth0, 2.eth1 and 3.eth0 are in te same SWITCH where the uplink is the cable-modem. As I explaned above, my ISP gives 2 IPs for each internet connection. I also do this so IPX protocol keeps all interfaces visible 'inside the switch'. Although I've been unable to find a program like samba for IPX (formerly there was a way, but just no longer)... but that's another topic.

Nevermind, I'll do that dhcp server client banning configuration for my LAN... and then I'll try to hack with those ARP tables... I still remark that this doesn't happen on windowze (or while the gateway is windowze, say it as you want).
Back to top
View user's profile Send private message
cdunham
Apprentice
Apprentice


Joined: 06 Jun 2003
Posts: 211
Location: Rhode Island

PostPosted: Fri Jun 27, 2003 3:44 pm    Post subject: Reply with quote

Perhaps I could suggest a better setup, one familiar to most of the rest of us doing this:

Machine A (two network cards):
eth0 - connection to ISP (not through switch) - dhcp
eth1 - lan dhcp - connected to switch
Does NAT with iptables

All Other Machines:
lan dhcp
connected to switch
one network card

You can make your setup work, but it's kind of a pain for what you need, I think.
_________________
This post more meaningful in a scalar context.
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Fri Jun 27, 2003 3:49 pm    Post subject: Reply with quote

cdunham wrote:
Perhaps I could suggest a better setup, one familiar to most of the rest of us doing this:

Machine A (two network cards):
eth0 - connection to ISP (not through switch) - dhcp
eth1 - lan dhcp - connected to switch
Does NAT with iptables

All Other Machines:
lan dhcp
connected to switch
one network card

You can make your setup work, but it's kind of a pain for what you need, I think.


Look. I know it seems intelligent but if my ISP gives me 2 IP addresses I want to use them. Let's say it's for environmental reasons (all my comps are inside my bedroom ;)) So I can't have the main computer powered on when I sleep because it's too noisy, while others are silent. So, imagine I want to have my laptop and my other computer online... As far as there is an eth with a public internet IP up, both will be connected... just please, don't tell me about recommendations, give me a solution to my configuration which WORKS UNDER WINDOWZE AS I SAID BEFORE... mmmm if you have a look at this theme: https://forums.gentoo.org/viewtopic.php?t=63498&start=0&postdays=0&postorder=asc&highlight= you'll see someone already has given me a solution for this... it seems that some things don't work as they should so I'll just add that MANUAL ARP entry and I hope problem will solve. You'll have news from me after when I REBOOT!

:wink:
Back to top
View user's profile Send private message
Deathwing00
Bodhisattva
Bodhisattva


Joined: 13 Jun 2003
Posts: 4087
Location: Dresden, Germany

PostPosted: Fri Jun 27, 2003 7:39 pm    Post subject: Reply with quote

Thank you very much to everybody! I realized that gentoo has the arping and that ARP does solve the problem as I expected! :) SO I just run at start this simple script...

Code:
# arping -q 192.168.0.2 &
# arping -q 192.168.0.3 &


Thanks a lot to everybody!

BTW, I don't need the dhcp server now
:)

The job the shcp server was supposed to do, (not really such dhcp but keeping up the LAN, has been satisfied with that... )
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum