LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-10-2024, 05:10 PM   #1
heliostarfish
LQ Newbie
 
Registered: Apr 2024
Posts: 2

Rep: Reputation: 0
ifconfig gives unknown host error?


I'm not sure what I'm missing. I am getting the error unknown host when I try to use ifconfig to set an ip address.

sudo ifconfig eth0 add 192.168.300.1 netmask 255.255.255.0

returns

192.168.300.1: Unknown host

This seems to be the example command used online. Is there something I'm missing?
 
Old 04-10-2024, 06:44 PM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
The correct command form is
Quote:
sudo ifconfig [interface_name] [IP] netmask [netmask_addresss] broadcast [broadcast_address]
Where did "add" come from?

Did you consult your man page?
 
Old 04-10-2024, 07:07 PM   #3
heliostarfish
LQ Newbie
 
Registered: Apr 2024
Posts: 2

Original Poster
Rep: Reputation: 0
Yup, add is in the man page for adding an ip address to an interface. The error was silly. 300 is out of range. Octets only go to 255!
 
Old 04-10-2024, 10:29 PM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,640

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
Quote:
Originally Posted by heliostarfish View Post
Yup, add is in the man page for adding an ip address to an interface. The error was silly. 300 is out of range. Octets only go to 255!
Now "I" feel silly! I read past that twice and read it as 200 both times!
 
  


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
macvlan on host, macvtap guest, routing via host gives error nikunjmaster Linux - Virtualization and Cloud 0 01-01-2014 06:44 PM
[SOLVED] ping www.google.co.in gives unknown host error ,ping to LAN address works fine aspiring_stellar Linux - Newbie 10 05-24-2011 03:26 PM
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM
i m getting the error unknown host while im pinging with the host name gunjan thakkar Linux - General 2 12-14-2004 01:19 PM
Resolver problem: ping localhost.localdomain gives Unknown host rmd Linux - Networking 0 11-06-2003 07:58 AM

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

All times are GMT -5. The time now is 10:41 AM.

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