LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-28-2013, 01:44 AM   #1
koan
LQ Newbie
 
Registered: Dec 2013
Posts: 3

Rep: Reputation: Disabled
Desktop assigned bad IP address through Devil Linux firewall


Hello all,

I'm trying to convert an old Pentium III I had lying around into a firewall and decided to use Devil Linux. I have a dual port adapter I'm using to connect to my router and my desktop on eth0 and eth1, respectively. I have a connection between the firewall and my router (which acts as a DHCP server) which correctly assigns the firewall an IP but my desktop keeps getting a 169.254.x.x address. I cleared my iptables rules to try to narrow down the problem and I believe it's because my desktop cannot connect to my router to be assigned an address.

I killed dhcpcd for both interfaces and re-ran it to try to reassign addresses and got the following output for eth0 (firewall to router):

Code:
eth0: soliciting an IPv6 router
eth0: rebinding lease of 192.168.1.6
eth0: leased 192.168.1.6 for 86400 seconds
eth0: adding host route to 192.168.1.6 via 127.0.0.1
eth0: adding route to 192.168.1.0/24
eth0: adding default route via 192.168.1.1
and the following output for eth1 (firewall to desktop):

Code:
eth1: soliciting an IPv6 router
eth1: using IPv4LL address 169.254.63.33
eth1: adding host route to 169.254.63.33 via 127.0.0.1
eth1: adding route to 169.254.0.0/16
How can I allow my desktop to reach my router to be assigned an address?
Also, my guess at the problem may very well be incorrect, are there any other suggestions as to what the issue could be?

Thanks for your time,
koan
 
Old 12-28-2013, 02:39 AM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
dhcpcd is a client and will not allocate IP's to anything. The IP you get on eth0 via dhcpcd comes from the router.

Your router will provide most of the protection you need from the Internet as far as firewalls go so there really is no need for a dedicated box unless you building a more complicated setup.

If you really want some additional protection or just want to stop certain ports from gaining outside access you can either run iptables on the desktop if it's Linux or use one of many firewall addons if it's Windows
 
Old 12-28-2013, 12:28 PM   #3
koan
LQ Newbie
 
Registered: Dec 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Wildwizard,
Thanks for your response. I understand that the router is the one assigning the IPs which is why I am wondering why my desktop cannot connect to it. If you have any information regarding that it would be very helpful.

Thanks,
Koan

EDIT: More specifically, if you have any information on what kind of iptables rule to use to allow my desktop to connect to my router, that would be most helpful. Should I tell the NAT table to masquerade on eth1 with addresses on the 192.168.1.0/24 subnet?

Last edited by koan; 12-28-2013 at 12:31 PM. Reason: specificity
 
Old 12-28-2013, 03:30 PM   #4
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 385Reputation: 385Reputation: 385Reputation: 385
Let me see if i get this right: You are connecting the router and the desktop in the firewall machine ?
If that is the case, and your firewall doesn't have a dhcp service then just set eth1 with static IP and also the desktop with static IP, make sure to set both on the same subnet. Besides that if you are connecting both machines with one cable make sure the it is a crossover cable, which allow to plug 2 machines directly with a network cable.

You could also reverse the firewall with the router, or yet remove the router out of the equation if you are using just 2 machines and the goal is to learn firewalling.

It is more interesting to have the firewall connected to the modem(if you have one) and then the router receiving the shared connection from the firewall, so the router will do the dhcp for the rest of your network if you have more machines to connect. In this case the router will need a static ip to connect with the firewall(if your firewall doesn't have dhcp service).

Using a router and a dedicated firewall is pretty much like having 2 firewalls.

Most important, make it simple because it will be easier to manage.

Regards

Last edited by ukiuki; 12-30-2013 at 04:46 AM.
 
Old 12-28-2013, 10:11 PM   #5
koan
LQ Newbie
 
Registered: Dec 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Ahhh, stupid mistake. I tried setting eth1 to a static IP but kept my desktop set to dynamic so it kept trying to reach a DHCP server that it was never going to find. I'll take another crack at it. The idea of switching the router and firewall also came to mind today, I'll definitely try that as well.
I realize this is an unusual and somewhat illogical scenario but it's just a project for fun to build some skill with linux networking.

Thanks for the response.
koan
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Program to assign globa lIPv6 address and bind() to the previously assigned address. mwnn Linux - Networking 2 10-07-2010 02:29 AM
How can I tell if my Linux server has a static or dynamic IP address assigned to it? RBMike Linux - Newbie 11 12-15-2009 05:05 PM
LXer: Devil-Linux distro bundles router/firewall and server in one live CD LXer Syndicated Linux News 0 09-26-2008 11:21 PM
Devil-Linux cd firewall mohapi Linux - Security 6 07-13-2005 06:46 AM
DHCP Server MAC Address found, IP address not assigned wmburke Linux - Wireless Networking 17 11-17-2004 10:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration