导航:首页 > 操作系统 > 在linux下如何上网

在linux下如何上网

发布时间:2023-06-07 18:39:38

linux怎么联网

Linux系统联网,下面以redhat为例,步骤如下:

1.修改网卡的配置文件

vim/etc/sysconfig/network-script/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="static"#如果是动态的,可以用dhcp;静态也可以用none
HWADDR="00:0C:29:D3:0C:DD"
IPV6INIT="yes"
IPADDR=192.168.1.169#IP地址
NETMASK=255.255.255.0#子网掩码
GATEWAY=192.168.1.1#网关
NM_CONTROLLED="yes"
ONBOOT="yes"#系统启动网卡开关

2.设置网络工作的开关

vim/etc/sysconfig/network
NETWORKING=yes#启动网络工作
HOSTNAME=picaso.localhost#主机名

⑵ 怎么用Linux命令联网

1、登陆Linux系统。先使用root账号及密码登陆linux界面(注:必须为管理员用户或权限),若是其它用户登陆,使用 su 命令切换用户,输入密码即可。

⑶ Linux下怎么上网

ifconfig
“ip”
“mask“
这个可以让你暂时上网,关机或者重启就不行了,想彻底解决要改配置文件,但linux的版本有很多,各版本都不一样配置文件路径也不同,建议到相应版本论坛查看。

⑷ Linux系统下怎么上网

在 Linux 系统中,首先必须要正确安装好网卡驱动程序。然后正确设置好 TCP/IP的各个参数,包括:IP地址(如果是自己上网,设置成自动获取 IP,如果是做服务器使用的话,就向 ISP 申请一个合法的静态 IP 地址)、子网掩码、网关、DNS,然后保证网线的连通性能良好、网络结构和机器连网的合理性。

⑸ Linux如何设置上网

linux上网设置经典二法

1、一种是linux共享局域网内的windows主机上网

如果你的网卡linux能够识别的话在安装的时候会有网卡配置过程。从列表中选择网络设备,一般为eth0,点击“编辑”,在打开的“编辑接口”对话框中,用户可以通过DHCP来配置网络,这样也可以,不过我更喜欢定制一个静态IP,所以去掉“使用DHCP进行配置”前面的选项,然后在下面输入你要定制的IP地址和子网掩码,确定后,在下面的网关和主要DNS里输入当前局域网上做为主机的计算机的IP地址。这样装完以后就搞定。

如果你是装完后再安装的网卡的话,那可以在“系统设置”里选择“网络”,如果你的网卡安装成功的话会在下面的列表里看到你的网卡,同样设置DNS(和上面一样),然后再回到列表里,选中你的网卡,点上面的编辑,选中“当计算机启动时激活设备”,然后选择下面的“静态设置的IP地址”,在下面输入和上面同样的设置。再重新启动就可以了。

2、另外一种就是用你的linux通过ADSL上网了

在linux下就集成着一个ADSL拨号软件,打开终端,在里面输入#adsl-setup,然后进行设置:

LOGIN NAME

Enter your Login Name (default root):(输入你的用户名)

INTERFACE

Enter the Ethernet interface connected to the ADSL modem
For Solaris, this is likely to be something like /dev/hme0.
For Linux, it will be ethX, where 'X' is a number.
(default eth0):(选择网络设备)

Do you want the link to come up on demand, or stay up continuously?
If you want it to come up on demand, enter the idle time in seconds
after which the link should be dropped. If you want the link to
stay up permanently, enter 'no' (two letters, lower-case.)
NOTE: Demand-activated links do not interact well with dynamic IP
addresses. You may have some problems with demand-activated links.
Enter the demand value (default no):(选择是按需拨号,还是持续连接)

DNS

Please enter the IP address of your ISP's primary DNS server.
If your ISP claims that 'the server will provide dynamic DNS addresses',
enter 'server' (all lower-case) here.
If you just press enter, I will assume you know what you are
doing and not modify your DNS setup.
Enter the DNS information here:(选择DNS)

PASSWORD

Please enter your Password:
Please re-enter your Password:

USERCTRL

Please enter 'yes' (two letters, lower-case.) if you want to allow
normal user to start or stop DSL connection (default yes):(是否允许普通用户启动、关闭)

The firewall choices are:
0 - NONE: This script will not set any firewall rules. You are responsible
for ensuring the security of your machine. You are STRONGLY
recommended to use some kind of firewall rules.
1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation
2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway
for a LAN
Choose a type of firewall (0-2):(选择firewall的规则)

Start this connection at boot time

Do you want to start this connection at boot time?
Please enter no or yes (default no):(选择是否随机启动)

** Summary of what you entered **

Ethernet Interface:
User name:
Activate-on-demand:
DNS addresses:
Firewalling:
User Control:
Accept these settings and adjust configuration files (y/n)?(确认一下是否接受设置)

以上的设置在“系统设置”里 的“网络”里选择新建,建立一个xDSL连接,也可以实现。设置完成了以后在网络里激活连接。

上面的ADSL连接就试过一次,由于我们是局域网,所以一直用的是共享上网,如果有什么错误不要骂我,还请指教!!

阅读全文

与在linux下如何上网相关的资料

热点内容
银行流水解压码是多少 浏览:895
百度哪个app好用 浏览:316
115广告联盟源码 浏览:494
联通app签到源码 浏览:680
怎么连接另一个服务器的数据库 浏览:742
猫盘洗白命令 浏览:844
168api源码 浏览:967
不同地方的文件服务器如何通信 浏览:599
自己电脑上搭建ftp服务器地址 浏览:977
程序员的秋招秘籍 浏览:821
单片机国内外研究现状 浏览:308
gta5如何进千人真实服务器 浏览:996
电脑html壁纸源码 浏览:726
c语言返回命令 浏览:933
加密软件会导致文件损坏吗 浏览:434
在别人服务器里如何使用命令方块 浏览:852
易语言源码转python 浏览:364
程序员日祝福 浏览:883
阿里tv助手app哪里下载 浏览:187
app活动怎么关 浏览:202