Fedora 配置

Posted eilinge

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Fedora 配置相关的知识,希望对你有一定的参考价值。

Fedora 28

开机自动配置Ip

1.设置ip

    1.启动网卡:ifconfig eno1 up |ifup eno1

    2.查看eno1状态:ethtool eno1

    3.获取网关:route Destination:default Gateway:10.240.176.0

    4.配置静态ip:vi /etc/sysconfig/network-scripts/ifcfg-eno1

             :/C:Userswuchan4xDocumentsOS issueFedora-infoifcfg-eno1

2.设置DNS,要不然不能通过域名访问地址

$ vim /etc/resolv.conf

    C:Userswuchan4xDocumentsOS issueFedora-info esolv.conf

3.重启网络服务

service network restart

 

设置镜像源

vi /etc/yum.repos.d/fedora.repo

        C:Userswuchan4xDocumentsOS issueFedora-infofedora.repo

配置代理:proxy

1.vim /etc/dnf/dnf.conf (永久)

        C:Userswuchan4xDocumentsOS issueFedora-infodnf.conf

2.export http_proxy=http://proxy-prc.intel.com:911 (临时)

 

遇到的问题:

ping baidu.com没问题,curl 1https://www.baidu.com 返回源代码

dnf -y update

Error: Failed to synchronize cache for repo ‘fedora‘ --无法连特殊的网站

resolve:

1.vim /etc/dnf/dnf.conf

add proxy=http://proxy-prc.intel.com:911

proxy_username=root

proxy_password=tester

2.service network restart

当同时开启2个网卡时,ethtool eno1 && eno2 :link yes 会导致无法上网

需要禁用掉一个网卡,ifconfig eno2 down

 

scp传输时如下报错

declare -x FTP_PROXY=‘http://proxy-prc.intel.com:911‘

#vim ~/.bashrc

删除添加的:FTP_PROXY=‘http://proxy-prc.intel.com:911‘

HTTP_PROXY=‘http://proxy-prc.intel.com:911‘

HTTPS_PROXY=‘http://proxy-prc.intel.com:911‘

 

添加ip地址:

ifcfg-eno1

HWADDR=0c:c4:7a:64:96:d6

NAME=enp5s0f0

ONBOOT=yes

TYPE=Ethernet

BOOTPROTO=static

IPADDR=10.240.176.254

NETMASK=255.255.255.128

GATEWAY=10.240.176.129

DNS=10.239.27.36

DNS=10.248.2.5

DNS=172.17.6.9

DEFROUTE=yes

PEERDNS=yes

PEERROUTES=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_PEERDNS=yes

IPV6_PEERROUTES=yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

 

镜像源设置:fedora.repo

[fedora] name=Fedora $releasever - $basearch

failovermethod=priority

#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/ metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch

enabled=1

metadata_expire=7d

repo_gpgcheck=0

type=rpm

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch

skip_if_unavailable=False

[fedora-debuginfo]

name=Fedora $releasever - $basearch - Debug

failovermethod=priority

#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/debug/tree/ metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch

enabled=0

metadata_expire=7d

r

epo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
 
[fedora-source]
name=Fedora $releasever - Source
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/source/tree/
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False

 

网关设置:resolv.conf

search icx.intel.com

nameserver 10.248.2.5

nameserver 10.239.27.36

nameserver 172.17.6.9

dnf设置代理:dnf.conf

[main]

gpgcheck=1

installonly_limit=3

clean_requirements_on_remove=True

proxy=http://proxy-prc.intel.com:911

 
















以上是关于Fedora 配置的主要内容,如果未能解决你的问题,请参考以下文章

linux fedora35中配置软件存储库:添加启用禁用

fedora下vim配置

Fedora25安装完成后需要做的——第一步——配置最基础的几个软件源

Fedora27 源配置

Fedora 配置

Redhat/Fedora 网络接口的配置文件和网络接口专用配置工具