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.
I am building a gentoo system using net-setup to manually configure my network with static ip. My question is what is a broadcast address. I am using a linksys router to connect my network. I already know what ip address I want to use. Is a broadcast address necessary for a non server machine? I will be running mysql server but no ftp, or web server. VNC may be run on occasion. Any help will be appreciated.
Distribution: Fedora Core 1 & WinXP Pro & Gentoo 1.4 & Arch Linux
Posts: 558
Rep:
Copy and pasted from gentoo handbook (don't kill me):
Code:
Manual Static Configuration
We need to setup just enough networking so that we can download sources for the system build, as well as the required localhost interface. The needed information is explained in the next table.
Information Description Example value
IP address The IP address you want to assign to your network card 192.168.1.2
Broadcast address The IP address which will broadcast the packets to all the hosts in the network 192.168.1.255
Network mask The mask which is used together with the IP address to see what part of the address is for network-identification and host-identification 255.255.255.0
Gateway The IP address of the computer which will forward the packets that are not meant for the local network (most of the time the computer which shares the internet connection) 192.168.1.1
Type in the following commands, replacing $IFACE with your network interface (typically eth0), $IPNUM with your IP address, $BCAST with your broadcast address and $NMASK with your network mask. For the route command, replace $GTWAY with your default gateway.
Code listing 4.6: Static IP Network Configuration
# ifconfig $IFACE $IPNUM broadcast $BCAST netmask $NMASK
# route add -net default gw $GTWAY netmask 0.0.0.0 metric 1 $IFACE
Now it is time to create the /etc/resolv.conf file so that name resolution (finding Web/FTP sites by name, rather than just by IP address) will work. You can use nano -w /etc/resolv.conf to create /etc/resolv.conf. nano is a small and easy-to-use editor.
Here is a template to follow for creating your /etc/resolv.conf file:
Code listing 4.7: /etc/resolv.conf template
domain mydomain.com
nameserver 10.0.0.1
nameserver 10.0.0.2
Replace 10.0.0.1 and 10.0.0.2 with the IP addresses of your primary and secondary DNS servers respectively.
Proxy Configuration
If you are behind a proxy, it could be necessary to configure your proxy before you continue. We will export some variables to set up the proxy accordingly.
Code listing 4.8: Setting a Proxy
(If the proxy restricts HTTP traffic:)
# export http_proxy="http://machine.company.com:1234"
(If the proxy restricts FTP traffic:)
# export ftp_proxy="ftp://machine.company.com"
(If the proxy restricts RSYNC traffic:)
# export RSYNC_PROXY="rsync://machine.company.com"
Note: If your proxy requires authentification, use a construct like http://username:password@machine.company.com (note the added "username:password@").
Networking is go!
Networking should now be configured and usable. You should be able to use the included ssh, scp, links, irssi and wget commands to connect to other machines on your LAN or the Internet.
The simple solution that works most of the time: set the broadcast address to the IP address of your network card, with the last field changed to 255. So, if your card is 192.168.0.20, set it to 192.168.0.255.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.