Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
In Linux I get a 192.x address which is a bad IP for my network. When I boot into windows, I get a 172.x address which is a good IP. I didn't change anything w/ networking. One day it worked fine, the next day networking doesn't work in Linux. Could some 1 plz lend a helping hand? Thank you.
i would reboot it, and scroll back thru /var/log/messages and see if there is anything about what server handed you the ip address. i dont know if it will be there, but its a good place to start.
Here is the first time I see this bad IP showing up. Can I have some help interperting this? Is there more info I can post?
Jun 9 16:10:36 localhost dhclient: DHCPOFFER from 192.168.0.1
Jun 9 16:11:07 localhost kernel: PCI: Enabling device 0000:00:08.0 (0000 -> 0003)
Jun 9 16:10:36 localhost dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Jun 9 16:11:07 localhost kernel: ACPI: PCI Interrupt Link [LNK6] enabled at IRQ 10
Jun 9 16:10:36 localhost dhclient: DHCPNAK from 172.17.1.12
Jun 9 16:11:07 localhost kernel: PCI: setting IRQ 10 as level-triggered
Jun 9 16:10:36 localhost dhclient: DHCPACK from 192.168.0.1
Jun 9 16:11:07 localhost kernel: ACPI: PCI interrupt 0000:00:08.0[A] -> GSI 10 (level, low) -> IRQ 10
Jun 9 16:10:36 localhost NET: /sbin/dhclient-script : updated /etc/resolv.conf
Jun 9 16:11:08 localhost kernel: ttyS47 at I/O 0x1428 (irq = 10) is a 8250
Jun 9 16:10:36 localhost dhclient: bound to 192.168.0.109 -- renewal in 292823 seconds.
Jun 9 16:11:08 localhost kernel: ttyS50 at I/O 0x1440 (irq = 10) is a 8250
Jun 9 16:10:36 localhost ifup: done.
Jun 9 16:11:08 localhost kernel: ttyS52 at I/O 0x1450 (irq = 10) is a 8250
Jun 9 16:10:46 localhost NET: /etc/sysconfig/network-scripts/ifup-post : updated /etc/resolv.conf
Jun 9 16:11:08 localhost kernel: ttyS54 at I/O 0x1460 (irq = 10) is a 8250
Jun 9 16:10:46 localhost network: Bringing up interface eth0: succeeded
Jun 9 16:11:08 localhost kernel: ttyS56 at I/O 0x1470 (irq = 10) is a 8250
Jun 9 16:10:46 localhost ifup:
Jun 9 16:11:08 localhost kernel: io scheduler noop registered
Jun 9 16:10:46 localhost ifup: Determining IP information for eth1...
Jun 9 16:11:09 localhost kernel: io scheduler anticipatory registered
Jun 9 16:10:47 localhost dhclient: DHCPDISCOVER on eth1 to 255.255.255.255 port 67 interval 8
Jun 9 16:11:09 localhost kernel: io scheduler deadline registered
Jun 9 16:10:47 localhost dhclient: DHCPOFFER from 192.168.0.1 <30>Jun 9 16:10:47 dhclient: DHCPREQUEST on eth1 to 255.255.255.255 port 67
Jun 9 16:11:09 localhost kernel: io scheduler cfq registered
Jun 9 16:10:47 localhost dhclient: DHCPNAK from 172.17.1.12
Jun 9 16:11:09 localhost kernel: RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
What are you getting the dhcp lease from, a router, a modem? You should be able to set it up so it only gives out leases on 192.168.1.0/192.168.1.100 or something like that.
I'm on a collage campus. My guess is that someone setup a wireless router backwards so that I'm getting my DHCP from them and not from the collage DHCP server. We have had this problem before, but this doesn't explain why I get a good IP running windows and my laptop (plugged into the same switch) setting next to me can't get a good IP. I get the same results on both machines only when I boot into linux. I thought it was a bad router setup until I booted into windows and got a good IP.
it could be that in windows, the preferred network settings prevent you from getting onto some other unsecured network. if your using wireless in linux, sounds like you need to dink with your SSID and preferred network settings.
When it's obvious that the server 192.168.0.1 is not the dhcp server you want, why not just block dhcp packets from that server (or flat out anything) with iptables?
DHCP works such that clients can remember for a little time their old ip, and then, when they ask for a new one, they ask if they can please have the same one again.
Your logs show two dhcp servers, one in 172, one in 192. Your linux box asks for a 192 address, and then the 172 server says "no, you can't", while 192 says "that's ok". And then linux proceeds to use the ip.
You could make linux forget its old ip by removing the file /var/lib/dhcp/dhclient.leases. Then it will take an ip from the first dhcp server that responds. I just hope its your campusses ;-)
Originally posted by blackdragonblood The only problem w/ that is that I'm a newbie and I don't understand iptables yet.
As root do this:
iptables -I INPUT 1 -s 192.168.0.1 -j DROP
This throws away any packet coming from the host with IP 192.168.0.1 and is destined for your computer. Seeing that the network you are in (or want to be in) isn't 192.168.0.0 you could (and probably should) throw out anything from misconfigured hosts anyway. For example:
iptables -A INPUT -s 192.168.0.0/16 -j DROP
iptables -A INPUT -s 10.0.0.0/8 -j DROP
There are better ways to do this but you should familiarize yourself with iptables first. Until then just use the rules above.
I got it to work. Big thanks for your help. Here's what I did to get it to work:
iptables -I INPUT -s 192.168.0.1 -j DROP
Quick Question:
After some research I understand iptables a little better. How do I list my current rules. I tried "iptables -L" and that didn't work. Is there something I'm doing wrong?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.