[SOLVED] Changing subnet IP address when configuring router: Slackware-14.2/x86_64
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.
Changing subnet IP address when configuring router: Slackware-14.2/x86_64
I'm not a network engineer but have run linux for many years; Slackware since 2003. It's not often that I need to configure a new router, but now I do, and sometimes changing the IP address of the laptop host to match the default router IP subnet (192.168.1.0/24) fails to work; that is the IP address is in that subnet but I cannot ping the router (192.168.1.1) nor open a browser tab to that address. I want to learn why it sometimes fails.
I know that ifconfig will bring the interface (eth0) up or down, but not change the IP address associated with it even though 'man ifconfig' suggests that ifconfig eth0 192.168.1.4 should work. Sometimes it does, most of the time it does not work.
I edit /etc/rc.d/rc.inet1.conf changing the IP address of eth0, then reboot the system. Usually, I need to follow that by manually running /etc/rc.d/rc.inet1 start, and sometimes also /etc/rc.d/rc.inetd start.
Even when ifconfig eth0 shows the correct ipv4 address and the interface is UP and RUNNING, I cannot ping from the laptop (192.168.1.4) to the router (192.168.1.1). I need to learn why so I can more quickly correct any connection problems in the future. Better yet, avoid them.
I used to have to configure some ip to serial boxes that came out of the subnet. Wasn't worth it to reboot windows so I'd just make a static arp entry in the subnet range and config the box to the correct ip in it's web page. Then remove static arp entry. Pretty simple if you don't forget the entry.
Ping is a rather poor test usually. Since you seem to suggest that your configurations are correct then maybe you need to look at (again) arp entries. They don't last long but things like browser cache and maybe some other things could remain there for a bit.
Responding to both Jefro and Lazydog by suggesting that I did not word my question as well as I could.
When I looked at the route on the laptop I discovered there was no default gateway route. That's most likely why the network was unreachable. I'll re-phrase my question this way:
Is there a defined series of steps to change a laptop's IP address and networking configuration to the default router subnet of 192.168.1.0/24? And one hat can easily be rolled back to the LAN's subnet once the router's WAN and LAN ports and firewall rules have been configured?
If I'm understanding you correctly you want to take a laptop, I'm going to aSSUME IT IS USING hdcp, to another network and use it there and when you are finished take it back to the original network. If both networks have a DHCP server then you shouldn't have to do anything except restart the interface which should automatically get the right ip/gateway information.
If the second network doesn't have a DHCP server then you can configure this interface by hand as follows:
Using ifconfig then you need to tell it everything i.e.,
Resolved this issue by setting eth0 to use DHCP rather than a static IP address. Once the router was configured I changed the laptop's eth0 back to a static IP address.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.